.deploy_docs 788 Bytes
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2
#!/bin/sh

3
LOCAL=$CI_BUILD_REF
Dion Haefner's avatar
Dion Haefner committed
4 5
git checkout $CI_BUILD_REF_NAME -q
REMOTE=$(git rev-parse $CI_BUILD_REF_NAME@{upstream})
6 7 8 9 10 11 12 13 14 15
git checkout $LOCAL -q

if [ "$LOCAL" = "$REMOTE" ]; then
	echo "Deploying documentation to dorie-docs.bitballoon.com"
	echo "{\"access_token\":\"$CI_BITBALLOON_TOKEN\",\"site_id\":\"$CI_BITBALLOON_ID\"}" > .bitballoon
 	if [[ -z build-cmake/doc/html/index.html ]]; then
 	    echo "ERROR: no index.html in doc folder"
        exit 1
	fi
	if ! command -v gem >/dev/null 2>&1; then
Dion Haefner's avatar
Dion Haefner committed
16
	    apt-get install ruby-dev -y
17 18 19 20 21 22
	fi
	if ! command -v bitballoon >/dev/null 2>&1; then
            gem install bitballoon
	fi
	bitballoon deploy build-cmake/doc/html
else
Dion Haefner's avatar
Dion Haefner committed
23
	echo "Commit $LOCAL is not the most recent commit on branch $CI_BUILD_REF_NAME ($REMOTE) - skipping deployment"
24
fi