From 6f29e408e8d5a9c1dbd990059a11d4dc17b902b8 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Wed, 13 Sep 2017 13:56:35 +0200 Subject: Drop, create and migrate database in ci. Refs #4468 --- lib/tasks/ci.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks/ci.rake') diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 90e47560e..ca70d1821 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -2,7 +2,7 @@ namespace :ci do desc "Prepare CI build" task :setup do cp "config/database/jenkins.yml", "config/database.yml" - sh "RAILS_ENV=test rake db:migrate" + sh "RAILS_ENV=test rake db:drop d:create db:migrate" sh "npm --production --no-progress install" end -- cgit v1.2.3 From 739d8f72dfccc858ce52db2d4a2222cce87418a4 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Wed, 13 Sep 2017 13:57:56 +0200 Subject: Fixes nice pre-commit typo o/. Refs #4468 --- lib/tasks/ci.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/tasks/ci.rake') diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index ca70d1821..69f5f9ca8 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -2,7 +2,7 @@ namespace :ci do desc "Prepare CI build" task :setup do cp "config/database/jenkins.yml", "config/database.yml" - sh "RAILS_ENV=test rake db:drop d:create db:migrate" + sh "RAILS_ENV=test rake db:drop db:create db:migrate" sh "npm --production --no-progress install" end -- cgit v1.2.3 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/ci.rake') 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