aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuc Donnet2017-09-13 16:56:23 +0200
committerLuc Donnet2017-09-13 16:56:23 +0200
commit3b7bbba3ce2f0a532ac7a8e7d1116e563526f112 (patch)
treeb49075ec37573ca7174794e3db6b7da12d92d583 /lib
parent5ee3a180de710d23ceb7660b1bcc454701b42d87 (diff)
parent4804a4886c5267c1be1c367caaf35c17c681d179 (diff)
downloadchouette-core-3b7bbba3ce2f0a532ac7a8e7d1116e563526f112.tar.bz2
Merge branch 'master' of github.com:AF83/stif-boiv
Diffstat (limited to 'lib')
-rw-r--r--lib/stif/reflex_synchronization.rb2
-rw-r--r--lib/tasks/ci.rake14
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/stif/reflex_synchronization.rb b/lib/stif/reflex_synchronization.rb
index b3f474221..a3bf3957e 100644
--- a/lib/stif/reflex_synchronization.rb
+++ b/lib/stif/reflex_synchronization.rb
@@ -38,7 +38,7 @@ module Stif
if object.valid?
object.save
else
- Rails.logger.error "Reflex:sync - #{object.class.model_name} with objectid #{object.objectid} and name #{object.name} can't be saved"
+ Rails.logger.error "Reflex:sync - #{object.class.model_name} with objectid #{object.objectid} can't be saved - errors : #{object.errors.messages}"
end
end
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"