Last active
December 17, 2015 16:39
-
-
Save anon5r/5640886 to your computer and use it in GitHub Desktop.
GitLab Auto Updater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BRANCH=master | |
if [ $# -ge 1 ]; then | |
BRANCH=$1 | |
fi | |
if [ "$SUDO_USER" != "" ] && [ "$SUDO_USER" != "git" ]; then | |
echo 'You are not user "git".' | |
export HOME=/home/git | |
export PATH=/home/git/.rbenv/shims:/home/git/.rbenv/bin:$PATH | |
alias git='sudo -u git -H git' | |
fi | |
echo "Updating Gitlab-Shell..." | |
cd $HOME/gitlab-shell | |
git checkout master && \ | |
git pull origin master \ | |
echo "done." | |
echo "Updating Gitlab..." | |
cd $HOME/gitlab | |
git checkout db/schema.rb && \ | |
git pull origin master && \ | |
bundle install --without development test postgres && \ | |
bundle exec rake db:migrate RAILS_ENV=production && \ | |
git checkout db/schema.rb ; \ | |
bundle exec rake gitlab:check RAILS_ENV=production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment