Microservice to handle the Contact form on placebazaar.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

deploy.rb 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # config valid for current version and patch releases of Capistrano
  2. lock '~> 3.10.2'
  3. set :application, 'placebazaar_contact'
  4. set :repo_url, 'git@github.com:placebazaar/contact.git'
  5. # Default branch is :master
  6. # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
  7. # Default deploy_to directory is /var/www/my_app_name
  8. set :deploy_to, '/u/apps/placebazaar_contact'
  9. # Default value for :format is :airbrussh.
  10. # set :format, :airbrussh
  11. # You can configure the Airbrussh format using :format_options.
  12. # These are the defaults.
  13. # set :format_options, command_output: true, log_file: 'log/capistrano.log',
  14. # color: :auto, truncate: :auto
  15. # Default value for :pty is false
  16. set :pty, true
  17. # Default value for :linked_files is []
  18. # append :linked_files, 'config/database.yml'
  19. # Default value for linked_dirs is []
  20. # append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets',
  21. # 'public/system'
  22. # Default value for default_env is {}
  23. # set :default_env, { path: '/opt/ruby/bin:$PATH' }
  24. # Default value for local_user is ENV['USER']
  25. # set :local_user, -> { `git config user.name`.chomp }
  26. # Default value for keep_releases is 5
  27. # set :keep_releases, 5
  28. # Uncomment the following to require manually verifying the host key before
  29. # first deploy.
  30. # set :ssh_options, verify_host_key: :secure
  31. namespace :systemd do
  32. desc 'Reload service'
  33. task :reload do
  34. on roles(:app) do
  35. systemctl :reload
  36. end
  37. end
  38. desc 'Show the status of service'
  39. task :status do
  40. on roles(:app) do
  41. systemctl :status
  42. end
  43. end
  44. def systemctl(action)
  45. sudo :systemctl, action, "#{fetch(:application)}.service"
  46. end
  47. end