diff --git a/config/deploy.rb b/config/deploy.rb index c63d24b..1b449f8 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -24,21 +24,20 @@ set :rvm_path, "$HOME/.rvm/scripts/rvm" # This task is the environment that is loaded for most commands, such as # `mina deploy` or `mina rake`. -task :environment do - # If you're using rbenv, use this to load the rbenv environment. - # Be sure to commit your .ruby-version or .rbenv-version to your repository. - invoke :'rvm:use[default]' +# Make sure that the deploy key is available +if ENV['CI'] === 'true' + `openssl aes-256-cbc -K $encrypted_82a37ece568a_key -iv $encrypted_82a37ece568a_iv -in deploy-rsa -out lightsaber-deploy -d` + `chmod 600 lightsaber-deploy` +end - # Make sure that the ssh key is available - 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 +task :environment do + invoke :'rvm:use[default]' end # 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 # all releases. +desc "Starts the current release" task :setup => :environment do queue "cd ~/lightsaber/current" queue "bundle exec thin -C config.yml start"