From 62ae1074e7536dd170b0214ed339b7ad9323967d Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Wed, 31 Aug 2016 11:03:09 +0200 Subject: Add additionnal_path in whenever variables to complete crontab PATH. Refs #1524 --- config/deploy.rb | 2 +- config/schedule.rb | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/deploy.rb b/config/deploy.rb index 99e3bab12..9171b51b4 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -24,7 +24,7 @@ require "bundler/capistrano" require 'whenever/capistrano' # Whenever -set :whenever_variables, ->{ "'environment=#{fetch :whenever_environment}&bundle_command=bin/bundle exec'" } # invoke bin/bundle to use 'correct' ruby environment +set :whenever_variables, ->{ "'environment=#{fetch :whenever_environment}&bundle_command=bin/bundle exec'&additionnal_path=/var/lib/gems/2.2.0/bin" } # invoke bin/bundle to use 'correct' ruby environment set :whenever_command, "sudo /usr/local/sbin/whenever-sudo" # use sudo to change www-data crontab set :whenever_user, "www-data" # use www-data crontab diff --git a/config/schedule.rb b/config/schedule.rb index 6adbc0219..258076d1b 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -19,6 +19,11 @@ # Learn more: http://github.com/javan/whenever +set :additionnal_path, '' +unless additionnal_path.empty? + env :PATH, "#{additionnal_path}:#{ENV['PATH']}" +end + every :hour do rake "organisations:sync" rake "users:sync" @@ -26,4 +31,4 @@ end every :day do rake "codifligne:sync" -end \ No newline at end of file +end -- cgit v1.2.3