Last active
August 29, 2016 07:23
-
-
Save sdogruyol/d19361ffa9115454064f9379e8dc7e40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lock '3.5.0' | |
set :application, 'your-app' | |
set :repo_url, 'https://github.com/your/app' | |
set :deploy_to, '/home/deploy/apps/your-app/' | |
namespace :deploy do | |
after :updated, :build do | |
on roles(:web) do | |
execute "cd '#{release_path}' && shards install" | |
execute "cd '#{release_path}' && crystal build --release src/app.cr" | |
end | |
end | |
end | |
namespace :kemal do | |
task :start do | |
on roles(:web) do | |
execute "#{release_path}/app >> #{shared_path}/kemal.log & echo $! > #{shared_path}/kemal.pid" | |
end | |
end | |
task :restart do | |
on roles(:web) do | |
invoke "kemal:stop" | |
invoke "kemal:start" | |
end | |
end | |
task :stop do | |
on roles(:web) do | |
execute "kill -INT $(cat #{shared_path}/kemal.pid) && rm #{shared_path}/kemal.pid" | |
end | |
end | |
end | |
after 'deploy:publishing', 'kemal:restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment