-
Notifications
You must be signed in to change notification settings - Fork 3
/
mina_deploy.rb
49 lines (44 loc) · 1.16 KB
/
mina_deploy.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
require 'mina/rails'
require 'mina/git'
require 'mina/secrets'
require 'mina/infinum'
set :application_name, 'awesome_app'
set :repository, 'git://...'
set :service_manager, :systemd
set :bundle_withouts, 'development test ci deploy'
# set :background_worker, 'dj' / 'sidekiq'
task :staging do
set :domain, 'staging.com'
set :deploy_to, '/home/$USERNAME/www/...'
set :user, '$USERNAME'
set :rails_env, 'staging'
# set :secrets_env, 'staging'
set :branch, 'staging'
end
task :production do
set :domain, 'production.com'
set :deploy_to, '/home/$USERNAME/www/...'
set :user, '$USERNAME'
set :rails_env, 'production'
# set :secrets_env, 'production'
set :branch, 'master'
end
task :deploy do
invoke :'git:ensure_pushed'
deploy do
invoke :'git:clone'
invoke :'deploy:link_shared_paths'
invoke :'bundle:install_gem'
invoke :'bundle:install'
command 'yarn install'
invoke :'secrets:pull'
invoke :'rails:db_migrate'
invoke :'rails:assets_precompile'
invoke :'deploy:cleanup'
on :launch do
invoke :restart_application
# invoke :'background_workers:restart'
# invoke :link_sidekiq_assets
end
end
end