Skip to content

Instantly share code, notes, and snippets.

@eusonlito
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eusonlito/b6418011782e78dbbabf to your computer and use it in GitHub Desktop.
Save eusonlito/b6418011782e78dbbabf to your computer and use it in GitHub Desktop.
#!/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