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.7KB

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