-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpost-receive
More file actions
25 lines (19 loc) · 847 Bytes
/
post-receive
File metadata and controls
25 lines (19 loc) · 847 Bytes
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
#!/bin/bash
APP_PATH=/var/www/farms/reviews
GIT_DIR=/var/repo/farms/reviews.git
[[ -s "/usr/local/rvm/bin/rvm" ]] && . "/usr/local/rvm/bin/rvm"
git --work-tree=${APP_PATH} --git-dir=${GIT_DIR} checkout -f
echo "========== CODE DEPLOYED =========="
cd ${APP_PATH}
/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin/bundle install --deployment
echo "========== BUNDLED =========="
echo "========== MIGRATING =========="
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/rake db:migrate RAILS_ENV=production
echo "========== MIGRATED =========="
echo "========== COMPILING ASSETS =========="
/usr/local/rvm/gems/ruby-2.0.0-p353/bin/rake assets:precompile RAILS_ENV=production
echo "========== ASSETS COMPILED =========="
echo "========== RESTARTING APP =========="
mkdir -p tmp
touch tmp/restart.txt
echo "========== APP RESTARTED =========="