Last active
August 29, 2015 14:15
-
-
Save eusonlito/b6418011782e78dbbabf to your computer and use it in GitHub Desktop.
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/bash | |
download=$(wget -q https://about.gitlab.com/downloads/ -O - | grep -oh 'https://downloads-packages.s3.amazonaws.com/ubuntu-14.04.*\.deb') | |
deb=$(basename "$download") | |
if [ -f "$deb" ]; then | |
echo '' | |
echo 'No updates. Last update deb is '$deb | |
echo '' | |
exit 0 | |
fi | |
echo '' | |
echo 'There are a new GitLab version '$deb | |
echo '' | |
read -p 'Do you want update current version? [y/N] ' yes | |
if [ "$yes" != 'y' ]; then | |
echo '' | |
echo 'Upgrade cancelled' | |
echo '' | |
exit 0 | |
fi | |
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
cd $DIR; | |
gitlab-rake gitlab:backup:create | |
gitlab-ctl stop unicorn | |
gitlab-ctl stop sidekiq | |
wget "$download" | |
dpkg -i "$deb" | |
cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab.rb.old | |
gitlab-ctl reconfigure | |
gitlab-ctl restart | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment