2016-02-22 18:03:57 +03:00
#!/bin/bash
2016-02-19 14:58:06 +03:00
set -e
2016-02-22 17:01:00 +03:00
if ( [ " $TRAVIS_BRANCH " = "master" ] || [ ! -z " $TRAVIS_TAG " ] ) && [ " $TRAVIS_PULL_REQUEST " = "false" ] ; then
echo "Deploying"
else
echo "Skipping deploy"
exit 0
fi
2016-02-19 14:58:06 +03:00
curl -LO https://github.com/tcnksm/ghr/releases/download/pre-release/linux_amd64.zip
unzip -q linux_amd64.zip
2016-02-22 17:35:51 +03:00
sudo mv ghr /usr/bin/ghr
2016-02-19 14:58:06 +03:00
sudo chmod +x /usr/bin/ghr
2016-02-24 17:41:25 +03:00
# github release and tag
2016-02-24 18:43:39 +03:00
ghr -t $GITHUB_TOKEN -u containous -r traefik --prerelease ${ VERSION } dist/
2016-02-24 17:41:25 +03:00
2016-04-04 23:33:01 +03:00
# update docs.traefik.io
mkdocs gh-deploy --clean
2016-02-24 17:41:25 +03:00
# update traefik-library-image repo (official Docker image)
git config --global user.email "emile@vauge.com"
git config --global user.name "Emile Vauge"
2016-04-04 23:33:01 +03:00
git clone git@github.com:containous/traefik-library-image.git
2016-02-24 17:41:25 +03:00
cd traefik-library-image
./update.sh $VERSION
git add -A
echo $VERSION | git commit --file -
echo $VERSION | git tag -a $VERSION --file -
2016-04-04 23:33:01 +03:00
git push -q --follow-tags -u origin master
2016-02-24 18:43:39 +03:00
# create docker image emilevauge/traefik (compatibility)
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
2016-03-08 15:16:58 +03:00
docker tag containous/traefik emilevauge/traefik:latest
2016-02-27 15:04:33 +03:00
docker push emilevauge/traefik:latest
docker tag emilevauge/traefik:latest emilevauge/traefik:${ VERSION }
2016-03-31 19:57:08 +03:00
docker push emilevauge/traefik:${ VERSION }
2016-02-24 18:43:39 +03:00
2016-02-24 17:41:25 +03:00
cd ..
rm -Rf traefik-library-image/
echo "Deployed"