Created
August 26, 2016 07:33
-
-
Save kai23/88d4bbe473ebb00c29fdeb7ed8021c7f to your computer and use it in GitHub Desktop.
Automatic Gitlab Update
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 | |
# Setting version of gitlab and dist wanted | |
version="8.11" | |
dist="ubuntu/trusty" | |
# The script | |
URL=https://packages.gitlab.com/gitlab/gitlab-ce/packages/$dist | |
echo "Getting last version ..." | |
package=`curl -s https://packages.gitlab.com/app/gitlab/gitlab-ce/search\?filter\=all\&q\=$version\&version\=$dist | grep -o "gitlab-ce_$version..............deb" | tail -n 1` | |
echo "Version found: $package" | |
if test -f "./$package"; then | |
echo "Version already exists !"; | |
exit 1; | |
fi | |
echo "Downloading $package..." | |
wget $URL/$package/download -O $package | |
echo "Installing" | |
dpkg -i $package | |
echo "Reconfigure" | |
gitlab-ctl reconfigure | |
echo "Restart" | |
gitlab-ctl restart | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment