File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1414set :deploy_to , '/home/tamnguyen/apps/rails_5_api'
1515set :repository , 'git@github.com:ntamvl/rails_5_api_tutorial.git'
1616set :branch , 'deploy'
17+ set :rails_env , 'production'
1718
1819# Optional settings:
1920# set :user, 'foobar' # Username in the server to SSH to.
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
106109 end
107110end
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
You can’t perform that action at this time.
0 commit comments