Skip to content

Commit

Permalink
Adding db migrate script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan OMara committed May 29, 2013
1 parent 334bffd commit 3f6701c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/dbmigrate
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
USERNAME=$(/usr/bin/id -un)
WANTED_USER=${1:-'foreman'}

if [ $USERNAME = $WANTED_USER ]; then
cd && scl enable ruby193 'rake db:migrate RAILS_ENV=production'
# cd && /usr/bin/scl enable ruby193 "bundle exec /usr/bin/rake db:migrate RAILS_ENV=production"
else
echo "$0 has to be run as user ${WANTED_USER}!"
exit 1
fi

0 comments on commit 3f6701c

Please sign in to comment.