29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/ssp/application/chef.rb', line 29
def deploy(app)
if options[:ssh_user] == "root"
raise Thor::Error, "You cannot deploy directly with the root user, use the -u option to specify your user"
end
chef_config
node = "#{options[:production] ? "#{app}-app-01" : "sage"}.sspti.me"
command = "sudo chef-client -V -l debug -L /tmp/#{app}_deploy_chef_run.#{Time.now.strftime("%Y%m%d%H%M")}.log | grep --line-buffered '\\[[^]]*\\] [A-Z]*:' | grep -v DEBUG:"
env = options[:production] ? "production" : "staging"
deploy_action = options[:rollback] ? "rollback" : options[:force] ? "force_deploy" : "deploy"
with_updated_bag(app, env, :deploy_action => deploy_action, :migrate => options[:migrate]) do
ssh_run(node, command)
end
end
|