16. Serverspec
“RSpec tests for your servers configured
by CFEngine, Puppet, Ansible, Itamae or anything else.”
http://serverspec.org/
% rake -T
rake mtest # Run mruby-mtest
rake spec # Run serverspec code for all
rake spec:base # Run serverspec code for base.minne.pbdev
rake spec:batch # Run serverspec code for batch.minne.pbdev
rake spec:db:master # Run serverspec code for master db
rake spec:db:slave # Run serverspec code for slave db
rake spec:gateway # Run serverspec code for gateway.minne.pbdev
(snip)
17. Drone CI
“CONTINUOUS INTEGRATION FOR GITHUB AND BITBUCKET THAT
MONITORS YOUR CODE FOR BUGS”
https://drone.io/
Drone CI は nyah と呼ばれる Openstack の上に構築
34. capistrano との統合
namespace :minne do
desc 'Deploy via Stretcher'
task :deploy do
set :deploying, true
invoke "minne:archive_project"
(ENV['ROLES'] || fetch(:minne_deploy_roles)).split(',').each do |target_role|
on application_builder_roles do
opts = ["-name deploy_#{target_role}_#{fetch(:stage)}"]
opts << "-node #{ENV['HOSTS']}" if ENV['HOSTS']
opts << “s3://your-buckets-name/manifest_#{target_role}.yml"
execute :consul, :event, *opts
end
end
end
before 'minne:deploy', 'slack:deploy:starting'
after 'minne:deploy', ‘slack:deploy:finished'
end
35. stretcher を用いて cap からデプロイ
1. build サーバーで rails + bundler gems + node modules +
assets 入りの tgz を作成、s3 にアップロード
2. stretcher 用の manifests を作成して s3 にアップロード
3. consul event を指定した roles に対して発行
4. event を受け取った role に所属するインスタンスで
stretcher が起動、コードの更新
$ bundle exec cap production minne:deploy