- convert.go: convert Feet to Meters
- temp.go: convert ºF to ªC
- smallest.go: find the smallest number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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'" |
- one
- two
- Vagrant: Descargar desde http://vagrantup.com
- Kitchen:
gem install kitchen
- Sitio web: http://getchef.com
git clone https://github.com/boris/chef.git
cd chef/site-cookbooks/packages
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.