From 881755f341a53d15ca40fddeaf48e001b26e6820 Mon Sep 17 00:00:00 2001 From: Karl Li Date: Thu, 19 Oct 2017 17:06:05 +0800 Subject: [PATCH] whenever_command_environment_variables should with capistrano env --- CHANGELOG.md | 2 ++ lib/whenever/capistrano/v3/tasks/whenever.rake | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c4115140..b4998079 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * Allow the use of string literals for month and day-of-week in raw cron syntax.. [Potamianos Gregory](https://github.com/javan/whenever/pull/711) +* Include Capistrano default environment variables when executing Whenever. [Karl Li](https://github.com/javan/whenever/pull/719) + ### 0.9.7 / June 14, 2016 * Restore compatibility with Capistrano v3; it has a bug which we have to work around [Ben Langfeld, Chris Gunther, Shohei Yamasaki] diff --git a/lib/whenever/capistrano/v3/tasks/whenever.rake b/lib/whenever/capistrano/v3/tasks/whenever.rake index ba5886cc..3c0806f6 100644 --- a/lib/whenever/capistrano/v3/tasks/whenever.rake +++ b/lib/whenever/capistrano/v3/tasks/whenever.rake @@ -33,7 +33,7 @@ namespace :load do task :defaults do set :whenever_roles, ->{ :db } set :whenever_command, ->{ [:bundle, :exec, :whenever] } - set :whenever_command_environment_variables, ->{ { rails_env: fetch(:whenever_environment) } } + set :whenever_command_environment_variables, ->{ fetch(:default_env).merge!(rails_env: fetch(:whenever_environment)) } set :whenever_identifier, ->{ fetch :application } set :whenever_environment, ->{ fetch :rails_env, fetch(:stage, "production") } set :whenever_variables, ->{ "environment=#{fetch :whenever_environment}" }