aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2014-12-11 20:49:07 +0100
committerHarald Eilertsen <haraldei@anduin.net>2014-12-11 20:49:07 +0100
commit1232a5e141a8af17cae52b8a486c71b1e2119437 (patch)
treed9158a21fecd3b921754ce4fcb8a56033c96bacb /lib
parent725c9f7f441d1a1280e22a3d7483fd33e5ee7237 (diff)
downloadhmnoweb-1232a5e141a8af17cae52b8a486c71b1e2119437.tar.gz
hmnoweb-1232a5e141a8af17cae52b8a486c71b1e2119437.tar.bz2
hmnoweb-1232a5e141a8af17cae52b8a486c71b1e2119437.zip
Generate piwik config directly rather than through erb.
Diffstat (limited to 'lib')
-rw-r--r--lib/capistrano/tasks/configure_piwik.rake17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/capistrano/tasks/configure_piwik.rake b/lib/capistrano/tasks/configure_piwik.rake
index dae2e28..93a697b 100644
--- a/lib/capistrano/tasks/configure_piwik.rake
+++ b/lib/capistrano/tasks/configure_piwik.rake
@@ -6,11 +6,18 @@ namespace :deploy do
output_file = File.join(shared_path, 'config', 'piwik.yml')
on roles(:app) do
unless test "[ -f #{output_file} ]"
- template = IO.read(File.join('config', 'piwik.yml.erb'))
- c = ERB.new(template)
- site_id = fetch(:piwik_site_id)
- url = fetch(:piwik_url)
- upload!(StringIO.new(c.result(binding)), output_file)
+ conf = {
+ fetch(:rails_env) => {
+ 'piwik' => {
+ 'id_site' => fetch(:piwik_site_id),
+ 'url' => fetch(:piwik_url),
+ 'disabled' => fetch(:piwik_disabled, false),
+ 'use_async' => fetch(:piwik_async, false),
+ }
+ }
+ }
+
+ upload!(StringIO.new(conf.to_yaml), output_file)
end
end
end