Skip to content

Instantly share code, notes, and snippets.

@kai23
Created August 26, 2016 07:33
Show Gist options
  • Save kai23/88d4bbe473ebb00c29fdeb7ed8021c7f to your computer and use it in GitHub Desktop.
Save kai23/88d4bbe473ebb00c29fdeb7ed8021c7f to your computer and use it in GitHub Desktop.
Automatic Gitlab Update
#!/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