aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/ci.rake
diff options
context:
space:
mode:
authorRobert2017-09-14 08:39:37 +0200
committerRobert2017-09-14 08:39:37 +0200
commit2f52ae9e95a61878eb9baecdeddbb8ab4f55c04d (patch)
treecfa73049ddb444c631ff3198fdc9033fa87dfd0d /lib/tasks/ci.rake
parent5d49813f7bc7b343141870fe291cea0100dad75e (diff)
parente11810f865239f5565c1b97c7e8da5f2b3108d29 (diff)
downloadchouette-core-2f52ae9e95a61878eb9baecdeddbb8ab4f55c04d.tar.bz2
Merge branch 'master' of github.com:af83/stif-boiv
Diffstat (limited to 'lib/tasks/ci.rake')
-rw-r--r--lib/tasks/ci.rake14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake
index 90e47560e..7fe289ed6 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 db:create db:migrate"
sh "npm --production --no-progress install"
end
@@ -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"