diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2014-12-07 22:36:37 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2014-12-07 22:36:37 +0100 |
commit | 94c8330dd73f872e844e91ffe6e5a45c70d07c8f (patch) | |
tree | d519d02b164f6bb2247a58a642e735cd1f7baf52 /lib/capistrano/tasks | |
parent | d01374d7221e11fc9d35f6f6100db08b5f3032c1 (diff) | |
download | hmnoweb-94c8330dd73f872e844e91ffe6e5a45c70d07c8f.tar.gz hmnoweb-94c8330dd73f872e844e91ffe6e5a45c70d07c8f.tar.bz2 hmnoweb-94c8330dd73f872e844e91ffe6e5a45c70d07c8f.zip |
Add capistrano task and config for deploying piwik.
Diffstat (limited to 'lib/capistrano/tasks')
-rw-r--r-- | lib/capistrano/tasks/configure_piwik.rake | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/capistrano/tasks/configure_piwik.rake b/lib/capistrano/tasks/configure_piwik.rake new file mode 100644 index 0000000..e56f37e --- /dev/null +++ b/lib/capistrano/tasks/configure_piwik.rake @@ -0,0 +1,20 @@ +# :mode=ruby: +namespace :deploy do + namespace piwik do + desc 'Configure piwik for site' + task :configure 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) + end + end + end + end + + before 'deploy', 'deploy:piwik:config' +end
\ No newline at end of file |