aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2017-12-26 19:45:43 +0100
committerHarald Eilertsen <haraldei@anduin.net>2017-12-26 19:45:43 +0100
commit42e4eaa01504dadd3ff37fce49119ae3f156b23e (patch)
treec9e66a6029ab268df0b4f04a24de201d658c7fa1 /lib
parent4bb64a9f140266dccd9601b653c71b556f96fad7 (diff)
downloadhmnoweb-42e4eaa01504dadd3ff37fce49119ae3f156b23e.tar.gz
hmnoweb-42e4eaa01504dadd3ff37fce49119ae3f156b23e.tar.bz2
hmnoweb-42e4eaa01504dadd3ff37fce49119ae3f156b23e.zip
Capistrano task for uploading puma config.
Diffstat (limited to 'lib')
-rw-r--r--lib/capistrano/tasks/configure_puma.rake15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/capistrano/tasks/configure_puma.rake b/lib/capistrano/tasks/configure_puma.rake
new file mode 100644
index 0000000..ccea36b
--- /dev/null
+++ b/lib/capistrano/tasks/configure_puma.rake
@@ -0,0 +1,15 @@
+# :mode=ruby:
+namespace :deploy do
+ desc 'Configure Puma'
+ task :configure_puma do
+ target_file = File.join(shared_path, 'config', 'puma.rb')
+ on roles(:app) do
+ unless test "[ -f #{target_file} ]"
+ template = ERB.new(IO.read(File.join(Dir.pwd, 'config', 'deploy', 'templates', 'puma.rb.erb')))
+ upload!(StringIO.new(template.result(binding)), target_file)
+ end
+ end
+ end
+
+ before 'deploy:finishing', 'deploy:generate_secret_token'
+end