From c44bdb5b0c8aa73fe1a42fc22bb2256bc9bd6c38 Mon Sep 17 00:00:00 2001 From: Mark Heiges Date: Wed, 24 Jan 2018 13:48:08 -0500 Subject: [PATCH] source RVM env in cron scripts --- roles/easyredmine/templates/redmine_fetch_changesets.j2 | 5 ++++- roles/easyredmine/templates/redmine_receive_imap.j2 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/roles/easyredmine/templates/redmine_fetch_changesets.j2 b/roles/easyredmine/templates/redmine_fetch_changesets.j2 index d776a6e..7dc944d 100755 --- a/roles/easyredmine/templates/redmine_fetch_changesets.j2 +++ b/roles/easyredmine/templates/redmine_fetch_changesets.j2 @@ -4,6 +4,9 @@ cd {{ redmine_root_dir }} -/usr/local/bin/bundle exec rake \ +[[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \ + source "{{ rvm1_install_path }}/scripts/rvm" + +{{ rvm1_install_path }}/gems/ruby-{{ ruby_version }}/bin/bundle exec rake \ eupathdb:fetch_changesets \ RAILS_ENV="production" diff --git a/roles/easyredmine/templates/redmine_receive_imap.j2 b/roles/easyredmine/templates/redmine_receive_imap.j2 index 049794a..3b6198b 100755 --- a/roles/easyredmine/templates/redmine_receive_imap.j2 +++ b/roles/easyredmine/templates/redmine_receive_imap.j2 @@ -2,7 +2,10 @@ cd {{ redmine_root_dir }} -/usr/local/bin/bundle exec rake \ +[[ -s "{{ rvm1_install_path }}/scripts/rvm" ]] && \ + source "{{ rvm1_install_path }}/scripts/rvm" + +{{ rvm1_install_path }}/gems/ruby-{{ ruby_version }}/bin/bundle exec rake \ redmine:email:receive_imap \ RAILS_ENV="production" \ project=sysdba \