Skip to content

Instantly share code, notes, and snippets.

@bitoiu
Created December 30, 2015 18:19
Show Gist options
  • Save bitoiu/46558a722f68c9f9b7fa to your computer and use it in GitHub Desktop.
Save bitoiu/46558a722f68c9f9b7fa to your computer and use it in GitHub Desktop.
Bash GitHub Enterprise setup
echo "Configuring GitHub Enterprise"
ghehost=`terraform output ghehost`
ghepass=`terraform output ghehost-admin-password`
gheport=8443
echo "Checking for GitHub Enterprise availability..."
for i in `seq 1 100`;
do
statuscode=`curl -sk -o /dev/null -I -m 5 -w "%{http_code}\n" https://$ghehost:$gheport/setup/start || true`
if [ $statuscode = "200" ]
then
echo "Success on attempt $i connecting to https://$ghehost:$gheport/setup/api/start"
sleep 10
break
else
echo "Attempt $i connecting to https://$ghehost:$gheport/setup/api/start failed"
fi
done
curl -kv -L -X POST "https://$ghehost:$gheport/setup/api/start" -F license=@etc/github-enterprise.ghl -F "password=$ghepass"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment