From 9e06e26c2e84ebb3556ff777fbacdec74e7796fe Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Mon, 20 Jul 2015 18:52:19 +0300 Subject: [PATCH] Avoid local mina/deploy.rb overwrite #2577 --- .gitignore | 1 + CHANGELOG.md | 1 + config/{deploy.rb => deploy-example.rb} | 13 ------------- doc/application_build_doc.md | 11 +++++++---- doc/certificates.md | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) rename config/{deploy.rb => deploy-example.rb} (94%) diff --git a/.gitignore b/.gitignore index d7933fa39..10d6b7678 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ capybara-*.html /spec/tmp **.orig config/initializers/secret_token.rb +config/deploy.rb config/secrets.yml config/database.yml /export diff --git a/CHANGELOG.md b/CHANGELOG.md index 60551518f..1333488cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ 20.07.2015 * New syntax for setting webclient IP-s (see config/application-example.yml) +* Example mina/deploy.rb renamed to mina/deploy-example.rb in order to not overwrite local deploy scripts 14.07.2015 diff --git a/config/deploy.rb b/config/deploy-example.rb similarity index 94% rename from config/deploy.rb rename to config/deploy-example.rb index d9944e0d1..7454fe0a7 100644 --- a/config/deploy.rb +++ b/config/deploy-example.rb @@ -219,19 +219,6 @@ task deploy: :environment do end end -desc 'Rolls back the latest release' -task rollback: :environment do - queue! %(echo "-----> Rolling back to previous release for instance: #{domain}") - queue %(ls "#{deploy_to}/releases" -Art | sort | tail -n 2 | head -n 1) - queue! %( - ls -Art "#{deploy_to}/releases" | sort | tail -n 2 | head -n 1 | - xargs -I active ln -nfs "#{deploy_to}/releases/active" "#{deploy_to}/current" - ) - to :launch do - invoke :restart - end -end - desc 'Loads current commit hash' task load_commit_hash: :environment do queue! %( diff --git a/doc/application_build_doc.md b/doc/application_build_doc.md index 3056b1992..800e014b9 100644 --- a/doc/application_build_doc.md +++ b/doc/application_build_doc.md @@ -24,7 +24,8 @@ Deploy overview: (database schema should be loaded and seeds should be present) git clone git@github.com:internetee/registry.git cd registry rbenv local 2.2.2 # more info about rbenv at debian doc - gem install mina + gem install mina # or any other deployment tool + cp config/deploy-example.rb config/deploy.rb # and edit it mina pr setup # one time, only creates missing directories ssh registry @@ -37,15 +38,17 @@ Deploy overview: (database schema should be loaded and seeds should be present) vi /etc/apache2/sites-enabled/epp.conf # add epp conf, restart apache exit # at your local machine - mina pr deploy # this is command you use in every application code update + mina pr deploy # for new update using mina tool as example ### Deploy script setup -We recommend [Mina](https://github.com/mina-deploy/mina) instead of Capistrano for deployment. +We recommend [Mina](https://github.com/mina-deploy/mina) instead of Capistrano or other tools for deployment. -All deploy code locates at config/deploy.rb file. +All deploy code locates at config/deploy.rb, please copy content from example file and edit it. + + cp config/deploy-example.rb config/deploy.rb # and edit it First add shortcuts to your local machine ssh config file, diff --git a/doc/certificates.md b/doc/certificates.md index 9d9a4ca7c..4caea4988 100644 --- a/doc/certificates.md +++ b/doc/certificates.md @@ -215,7 +215,7 @@ After deploy, in rails console: Certificate.update_crl -Update cron: +Update cron (mina tool example, when installed correctly): mina cron:setup