Skip to content

Commit 6034158

Browse files
committed
update deploy config
1 parent ab1d79d commit 6034158

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

config/deploy.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
set :deploy_to, '/home/tamnguyen/apps/rails_5_api'
1515
set :repository, 'git@github.com:ntamvl/rails_5_api_tutorial.git'
1616
set :branch, 'deploy'
17+
set :rails_env, 'production'
1718

1819
# Optional settings:
1920
# set :user, 'foobar' # Username in the server to SSH to.
@@ -78,6 +79,8 @@
7879
invoke :'bundle:install'
7980
# invoke :'rails:db_migrate'
8081
# invoke :'rails:assets_precompile'
82+
invoke :'my_db_migrate'
83+
invoke :'my_assets_clean'
8184
invoke :'deploy:cleanup'
8285

8386
on :launch do
@@ -106,6 +109,20 @@
106109
end
107110
end
108111

112+
task :my_db_migrate do
113+
in_path(fetch(:current_path)) do
114+
comment %{Running command rails db:migrate for Rails 5+...}
115+
command %{rails db:migrate RAILS_ENV=production}
116+
end
117+
end
118+
119+
task :my_assets_clean do
120+
in_path(fetch(:current_path)) do
121+
comment %{Running command rails tmp:clear for Rails 5+...}
122+
command %{rails tmp:clear RAILS_ENV=production}
123+
end
124+
end
125+
109126
# For help in making your deploy script, see the Mina documentation:
110127
#
111128
# - https://github.com/mina-deploy/mina/docs

0 commit comments

Comments
 (0)