|
| 1 | +# config valid only for current version of Capistrano |
| 2 | +lock '3.5.0' |
| 3 | + |
| 4 | +set :application, 'yep_ws_server' |
| 5 | +set :repo_url, '[email protected]:me/my_repo.git' |
| 6 | + |
| 7 | +# Default branch is :master |
| 8 | +# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp |
| 9 | + |
| 10 | +# Default deploy_to directory is /var/www/my_app_name |
| 11 | +set :deploy_to, "/u/apps/#{fetch(:application)}" |
| 12 | + |
| 13 | +# Default value for :scm is :git |
| 14 | +# set :scm, :git |
| 15 | + |
| 16 | +# Default value for :format is :airbrussh. |
| 17 | +# set :format, :airbrussh |
| 18 | + |
| 19 | +# You can configure the Airbrussh format using :format_options. |
| 20 | +# These are the defaults. |
| 21 | +# set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto |
| 22 | + |
| 23 | +# Default value for :pty is false |
| 24 | +# set :pty, true |
| 25 | + |
| 26 | +# Default value for :linked_files is [] |
| 27 | +set :linked_files, fetch(:linked_files, ['.env', '.ruby-version', 'yep_ws_server.pill']) |
| 28 | + |
| 29 | +# Default value for linked_dirs is [] |
| 30 | +set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets') |
| 31 | + |
| 32 | +# Default value for default_env is {} |
| 33 | +# set :default_env, { path: "/opt/ruby/bin:$PATH" } |
| 34 | + |
| 35 | +# Default value for keep_releases is 5 |
| 36 | +# set :keep_releases, 5 |
| 37 | + |
| 38 | +set :rbenv_ruby, '2.2.2' |
| 39 | +set :rbenv_custom_path, '/opt/rbenv' |
| 40 | + |
| 41 | +# Server |
| 42 | +set :goliath_worker_processes, 1 |
| 43 | +set :goliath_start_port, 10000 |
| 44 | +set :goliath_pidfile_path, 'tmp/pids' |
| 45 | +set :goliath_env, fetch(:stage) |
| 46 | + |
| 47 | +namespace :deploy do |
| 48 | + task :start do |
| 49 | + invoke 'yep_ws_server:start' |
| 50 | + invoke 'bluepill:load' |
| 51 | + end |
| 52 | + |
| 53 | + task :restart do |
| 54 | + invoke 'yep_ws_server:restart' |
| 55 | + end |
| 56 | + |
| 57 | + task :stop do |
| 58 | + invoke 'bluepill:quit' |
| 59 | + invoke 'yep_ws_server:stop' |
| 60 | + end |
| 61 | + |
| 62 | + after 'deploy:published', 'yep_ws_server:restart', 'bluepill:load' |
| 63 | +end |
0 commit comments