From 87ecd0d5585c2cb0ebe3f37735883d617909bf4c Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Wed, 13 Sep 2017 14:42:36 +0200 Subject: Disable deploy when not in master/staging or production. Refs #4468 --- lib/tasks/ci.rake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/tasks') diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 69f5f9ca8..7fe289ed6 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -19,7 +19,11 @@ namespace :ci do end def deploy_env - git_branch.in?(deploy_envs) ? git_branch : "dev" + if git_branch == "master" + "dev" + elsif git_branch.in?(deploy_envs) + git_branch + end end desc "Check security aspects" @@ -37,7 +41,11 @@ namespace :ci do desc "Deploy after CI" task :deploy do - sh "cap #{deploy_env} deploy:migrations" + if deploy_env + sh "cap #{deploy_env} deploy:migrations" + else + puts "No deploy for branch #{git_branch}" + end end desc "Clean test files" -- cgit v1.2.3