12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- require 'dotenv'
- Dotenv.load
- lock '3.4.0'
- set :application, 'huginn'
- set :repo_url, ENV['CAPISTRANO_DEPLOY_REPO_URL'] || 'https://github.com/cantino/huginn.git'
- set :branch, ENV['BRANCH'] || 'master'
- set :deploy_to, '/home/huginn'
- set :log_level, :info
- set :linked_files, fetch(:linked_files, []).push('.env', 'Procfile', 'config/unicorn.rb')
- set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle')
- set :bundle_jobs, 4
- set :conditionally_migrate, true
- task :deploy => [:production]
- namespace :deploy do
- after 'check:make_linked_dirs', :migrate_to_cap do
- on roles(:all) do
-
- next if test('[ -L ~/huginn ]')
- fetch(:linked_files).each do |f|
- if !test("[ -f ~/shared/#{f} ] ") && test("[ -f ~/huginn/#{f} ]")
- execute("cp ~/huginn/#{f} ~/shared/#{f}")
- end
- end
- execute('mv ~/huginn ~/huginn.manual')
- execute('ln -s ~/current ~/huginn')
- end
- end
- after :publishing, :restart do
- on roles(:all) do
- within release_path do
- execute :rake, 'production:restart'
- end
- end
- end
- end
|