aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/config_files.rake
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-06-24 11:19:43 +0100
committerGareth Rees <gareth@mysociety.org>2015-06-24 11:19:43 +0100
commit2cce1794a4d9d2c42b83bab8a693900e8ca23ebc (patch)
tree7408a04d5ac0963ec2defbbf7d4955cff7cd62b5 /lib/tasks/config_files.rake
parented6b256539e0dcaa3764951d90e2dc599a8acddd (diff)
parent54ba7a4fa232ad3b57310551b9a5e19d72060abe (diff)
Merge branch 'develop' into release-22-develop
Diffstat (limited to 'lib/tasks/config_files.rake')
-rw-r--r--lib/tasks/config_files.rake16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake
index f6b25185e..d0dc8f594 100644
--- a/lib/tasks/config_files.rake
+++ b/lib/tasks/config_files.rake
@@ -21,6 +21,22 @@ namespace :config_files do
converted_lines
end
+ desc 'Convert wrapper example in config to a form suitable for running mail handling scripts with rbenv'
+ task :convert_wrapper => :environment do
+ example = 'rake config_files:convert_wrapper DEPLOY_USER=deploy SCRIPT_FILE=config/run-with-rbenv-path.example'
+ check_for_env_vars(['DEPLOY_USER',
+ 'SCRIPT_FILE'], example)
+
+ replacements = {
+ :user => ENV['DEPLOY_USER'],
+ }
+
+ # Generate the template for potential further processing
+ convert_ugly(ENV['SCRIPT_FILE'], replacements).each do |line|
+ puts line
+ end
+ end
+
desc 'Convert Debian example init script in config to a form suitable for installing in /etc/init.d'
task :convert_init_script => :environment do
example = 'rake config_files:convert_init_script DEPLOY_USER=deploy VHOST_DIR=/dir/above/alaveteli VCSPATH=alaveteli SITE=alaveteli SCRIPT_FILE=config/alert-tracks-debian.example'