# config valid for current version and patch releases of Capistrano
lock "~> 3.19.1"

set :application, "weiling-company"
set :repo_url, "git@git.g77k.com:huxl/novotech.git"

# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
set :branch, "weiling.co"

# Default deploy_to directory is /var/www/my_app_name
# set :deploy_to, "/var/www/my_app_name"
set :deploy_to, "/www/#{fetch(:application)}"

set :use_sudo, false

# Default value for :format is :airbrussh.
# set :format, :airbrussh

# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto

# Default value for :pty is false
# set :pty, true

# Default value for :linked_files is []
# Notes: database.yml file should placed in shared/config directory before deploy
# Notes: secrets.yml file should placed in shared/config directory before deploy
append :linked_files, "config/database.yml", "config/secrets.yml", "db/production.sqlite3"

# Default value for linked_dirs is []
append :linked_dirs, ".bundle", "vendor/bundle", "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system", 'node_modules'

# Default value for default_env is {}
set :default_env, { path: "/usr/local/node-v16.13.0-linux-x64/bin:/usr/local/ruby-3.2.4/bin:$PATH" }

set :puma_user, fetch(:user)
set :puma_threads, [0, 4] # After changed this, invoke: bundle exec cap production puma:config
set :puma_workers, 1
set :puma_tag, fetch(:application)
set :nginx_server_name, "weiling.co"
set :nginx_server_port, 81

# /etc/systemd/system/puma_weiling-company_production.service

# Default value for local_user is ENV['USER']
# set :local_user, -> { `git config user.name`.chomp }

# Default value for keep_releases is 5
# set :keep_releases, 5

# Uncomment the following to require manually verifying the host key before first deploy.
# set :ssh_options, verify_host_key: :secure