Skip to content

Instantly share code, notes, and snippets.

View boris's full-sized avatar
🇨🇱
Building from home

Boris Quiroz boris

🇨🇱
Building from home
View GitHub Profile
@boris
boris / deploy.rb
Created May 13, 2014 18:56
this snippet allows you to run `cap rails:console` to connect to your rails console :neckbeard:
namespace :rails do
desc "open console"
task :console do
on roles(:app) do |host|
rails_env = fetch(:stage)
execute_interactively "~/.rbenv/shims/bundle exec rails console #{rails_env}"
end
end
end
@boris
boris / deploy.rb
Created May 20, 2014 22:05
Copy files to remote directory using Capistrano 3
namespace :devops do
desc "Copy files"
task :copy do
on roles(:all) do |host|
%w[ file.one file.two ].each do |f|
upload! '/path/to/file/' + f , '/remote/path/' + f
end
end
end
end
@boris
boris / README.md
Last active August 29, 2015 14:03
Golang exercises.

Golang Excercises

  • convert.go: convert Feet to Meters
  • temp.go: convert ºF to ªC
  • smallest.go: find the smallest number
@boris
boris / Vagrantfile
Created August 1, 2014 15:13
Vagrantfile that will allow you to have more than one vagrant instance (default). To each instance, you can use all the options available (network, provision, etc, etc)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "instance0" do |d|
d.vm.box = "ubuntu/trusty64"
d.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'"
@boris
boris / test.md
Last active January 22, 2017 03:27
  • one
  • two
@boris
boris / demo.md
Last active August 29, 2015 14:07
DevOps Tools: Chef + Vagrant
@boris
boris / push_to_deploy.md
Created May 1, 2015 23:25
push_to_deploy

Pruebas con git push-to-deploy

Crear directorios de prueba

vagrant@testing:~$ mkdir push-to-deploy
vagrant@testing:~$ cd push-to-deploy/
vagrant@testing:~/push-to-deploy$ mkdir {dev,remote,deploy}
vagrant@testing:~/push-to-deploy$ ls
deploy  dev  remote

Software Freedom Day 2015 - Demo

Presentación Aquí

Repositorio de prueba

git clone https://github.com/boris/chef.git
cd chef/site-cookbooks/packages
@boris
boris / tarea_prey.md
Last active February 2, 2016 20:44
Tarea Prey Señor DevOps

Escribir un cookbook de chef que permita instalar la versión 2.8.0 de redis. Este cookbook debe tener la estructura típica de un cookbook standard. Esto es:

├── .gitignore
├── .kitchen.yml
├── CHANGELOG.md
├── README.md
├── attributes
│   ├── default.rb
│   └── source.rb
├── metadata.rb
  • Revisión de branch fix-prod-staging-path
  • Aclaración de conceptos de chef:
    • Environment: Como "mapeamos" nuestra infraestructura, de acá manejamos que versiones instalamos en desarrollo, staging y producción.
    • Role: Definición de ciertos patrones que existen dentro de la infraestrucutra: web servers, backups, cron, lb, etc.
    • Cookbook: Unidad fundamental. Define el escenario. Contiene recetas, atributos, archivos, templates, etc.
    • Recipe: Es la unidad "mas" fundamental y define qué se debe hacer.
    • Otros: workstation, node, server, run-list, chef-run
  • Test Kitchen:
    • Especie de integración continua, permite probar recetas en nuestra workstation
  • Ejemplo.