aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/config_files.rake
diff options
context:
space:
mode:
authorMark Longair <mhl@pobox.com>2013-11-15 11:39:12 +0000
committerMark Longair <mhl@pobox.com>2013-11-15 11:39:12 +0000
commit64618741c17760fcb59647d74d1ccaff56160b15 (patch)
treed84f1f035b136180f0bdacb22895fbb0f1abf2c1 /lib/tasks/config_files.rake
parent96b3b5adbdafb25e5ab6ca94b89d6682a2e8f0e4 (diff)
parentcda26c36f309cdd8e8bbab9186f6cc0d4876e6c9 (diff)
Merge branch 'release/0.15' into wdtk
Conflicts: lib/tasks/stats.rake
Diffstat (limited to 'lib/tasks/config_files.rake')
-rw-r--r--lib/tasks/config_files.rake26
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/tasks/config_files.rake b/lib/tasks/config_files.rake
index d3843f3a4..d0e4001f0 100644
--- a/lib/tasks/config_files.rake
+++ b/lib/tasks/config_files.rake
@@ -11,11 +11,7 @@ namespace :config_files do
var = $1.to_sym
replacement = replacements[var]
if replacement == nil
- if ! (skip[var] == true)
- raise "Unhandled variable in .ugly file: $#{var}"
- else
- match
- end
+ raise "Unhandled variable in .ugly file: $#{var}"
else
replacements[var]
end
@@ -52,5 +48,23 @@ namespace :config_files do
end
end
+ desc 'Convert Debian .ugly crontab file in config to a form suitable for installing in /etc/cron.d'
+ task :convert_crontab => :environment do
+ example = 'rake config_files:convert_crontab DEPLOY_USER=deploy VHOST_DIR=/dir/above/alaveteli VCSPATH=alaveteli SITE=alaveteli CRONTAB=config/crontab-example'
+ check_for_env_vars(['DEPLOY_USER',
+ 'VHOST_DIR',
+ 'VCSPATH',
+ 'SITE',
+ 'CRONTAB'], example)
+ replacements = {
+ :user => ENV['DEPLOY_USER'],
+ :vhost_dir => ENV['VHOST_DIR'],
+ :vcspath => ENV['VCSPATH'],
+ :site => ENV['SITE']
+ }
+ convert_ugly(ENV['CRONTAB'], replacements).each do |line|
+ puts line
+ end
+ end
-end \ No newline at end of file
+end