Always restart on deploys
This commit is contained in:
parent
1a8ca67684
commit
656224e26e
|
@ -29,26 +29,23 @@ task :environment do
|
||||||
# Be sure to commit your .ruby-version or .rbenv-version to your repository.
|
# Be sure to commit your .ruby-version or .rbenv-version to your repository.
|
||||||
invoke :'rvm:use[default]'
|
invoke :'rvm:use[default]'
|
||||||
|
|
||||||
# For those using RVM, use this to load an RVM version@gemset.
|
# Make sure that the ssh key is available
|
||||||
# invoke :'rvm:use[ruby-1.9.3-p125@default]'
|
if ENV['CI'] === 'true'
|
||||||
|
queue "openssl aes-256-cbc -K $encrypted_82a37ece568a_key -iv $encrypted_82a37ece568a_iv -in deploy-rsa -out lightsaber-deploy -d"
|
||||||
|
queue "chmod 600 lightsaber-deploy"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Put any custom mkdir's in here for when `mina setup` is ran.
|
# Put any custom mkdir's in here for when `mina setup` is ran.
|
||||||
# For Rails apps, we'll make some of the shared paths that are shared between
|
# For Rails apps, we'll make some of the shared paths that are shared between
|
||||||
# all releases.
|
# all releases.
|
||||||
task :setup => :environment do
|
task :setup => :environment do
|
||||||
|
queue "cd ~/lightsaber/current"
|
||||||
|
queue "bundle exec thin -C config.yml start"
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Deploys the current version to the server."
|
desc "Deploys the current version to the server."
|
||||||
task :deploy => :environment do
|
task :deploy => :environment do
|
||||||
to :before_hook do
|
|
||||||
# Don't try to decrypt it locally
|
|
||||||
if ENV['CI'] === 'true'
|
|
||||||
queue "openssl aes-256-cbc -K $encrypted_82a37ece568a_key -iv $encrypted_82a37ece568a_iv -in deploy-rsa -out lightsaber-deploy -d"
|
|
||||||
queue "chmod 600 lightsaber-deploy"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
deploy do
|
deploy do
|
||||||
# Put things that will set up an empty directory into a fully set-up
|
# Put things that will set up an empty directory into a fully set-up
|
||||||
# instance of your project.
|
# instance of your project.
|
||||||
|
@ -56,13 +53,8 @@ task :deploy => :environment do
|
||||||
invoke :'bundle:install'
|
invoke :'bundle:install'
|
||||||
|
|
||||||
to :launch do
|
to :launch do
|
||||||
if File.exists?('/tmp/lightsaber.pid')
|
queue "echo Restarting thin server"
|
||||||
queue! "bundle exec thin -C config.yml stop"
|
queue! "bundle exec thin -C config.yml restart"
|
||||||
queue! "rm /tmp/lightsaber.pid"
|
|
||||||
queue! "bundle exec thin -C config.yml start"
|
|
||||||
else
|
|
||||||
queue "bundle exec thin -C config.yml start"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue