2016-02-22 15:03:57 +00:00
|
|
|
#!/bin/bash
|
2016-02-19 11:58:06 +00:00
|
|
|
set -e
|
|
|
|
|
2016-05-30 21:12:26 +00:00
|
|
|
if [ -n "$TRAVIS_TAG" ] && [ "$DOCKER_VERSION" = "1.10.1" ]; then
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Deploying..."
|
2016-02-22 14:01:00 +00:00
|
|
|
else
|
|
|
|
echo "Skipping deploy"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-04-06 16:43:27 +00:00
|
|
|
git config --global user.email "emile@vauge.com"
|
|
|
|
git config --global user.name "Emile Vauge"
|
|
|
|
|
2016-04-05 18:47:38 +00:00
|
|
|
# load ssh key
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Loading key..."
|
2016-04-06 13:28:25 +00:00
|
|
|
openssl aes-256-cbc -d -k "$pass" -in .travis/traefik.id_rsa.enc -out ~/.ssh/traefik.id_rsa
|
2016-04-05 18:47:23 +00:00
|
|
|
eval "$(ssh-agent -s)"
|
|
|
|
chmod 600 ~/.ssh/traefik.id_rsa
|
|
|
|
ssh-add ~/.ssh/traefik.id_rsa
|
|
|
|
|
|
|
|
# download github release
|
|
|
|
echo "Downloading ghr..."
|
2016-10-17 21:41:06 +00:00
|
|
|
curl -LOs https://github.com/tcnksm/ghr/releases/download/v0.5.0/ghr_v0.5.0_linux_amd64.zip
|
2016-10-19 09:49:24 +00:00
|
|
|
unzip -q ghr_v0.5.0_linux_amd64.zip
|
2016-02-22 14:35:51 +00:00
|
|
|
sudo mv ghr /usr/bin/ghr
|
2016-02-19 11:58:06 +00:00
|
|
|
sudo chmod +x /usr/bin/ghr
|
|
|
|
|
2016-02-24 14:41:25 +00:00
|
|
|
# github release and tag
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Github release..."
|
2016-12-17 11:17:05 +00:00
|
|
|
tar cfz dist/traefik-${VERSION}.src.tar.gz --exclude-vcs --exclude dist .
|
2016-07-21 15:33:14 +00:00
|
|
|
ghr -t $GITHUB_TOKEN -u containous -r traefik ${VERSION} dist/
|
2016-02-24 14:41:25 +00:00
|
|
|
|
2016-04-04 20:33:01 +00:00
|
|
|
# update docs.traefik.io
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Generating and updating documentation..."
|
2016-04-07 13:32:20 +00:00
|
|
|
# DOESN'T WORK :'(
|
|
|
|
# git remote add ssh git@github.com:containous/traefik.git
|
|
|
|
# mkdocs gh-deploy -m $VERSION -c -r ssh
|
|
|
|
|
|
|
|
mkdir site
|
|
|
|
cd site
|
|
|
|
git init
|
|
|
|
git remote add origin git@github.com:containous/traefik.git
|
|
|
|
git fetch origin
|
|
|
|
git checkout gh-pages
|
|
|
|
cd ..
|
|
|
|
mkdocs build --clean
|
|
|
|
cd site
|
|
|
|
git add .
|
|
|
|
echo $VERSION | git commit --file -
|
|
|
|
git push -q -f origin gh-pages > /dev/null 2>&1
|
2016-04-04 20:33:01 +00:00
|
|
|
|
2016-02-24 14:41:25 +00:00
|
|
|
# update traefik-library-image repo (official Docker image)
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Updating traefik-library-imag repo..."
|
2016-04-04 20:33:01 +00:00
|
|
|
git clone git@github.com:containous/traefik-library-image.git
|
2016-02-24 14:41:25 +00: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-06 16:43:27 +00:00
|
|
|
git push -q --follow-tags -u origin master > /dev/null 2>&1
|
2016-02-24 15:43:39 +00:00
|
|
|
|
|
|
|
# create docker image emilevauge/traefik (compatibility)
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Updating docker emilevauge/traefik image..."
|
2016-02-24 15:43:39 +00:00
|
|
|
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
|
2016-03-08 12:16:58 +00:00
|
|
|
docker tag containous/traefik emilevauge/traefik:latest
|
2016-02-27 12:04:33 +00:00
|
|
|
docker push emilevauge/traefik:latest
|
|
|
|
docker tag emilevauge/traefik:latest emilevauge/traefik:${VERSION}
|
2016-03-31 16:57:08 +00:00
|
|
|
docker push emilevauge/traefik:${VERSION}
|
2016-02-24 15:43:39 +00:00
|
|
|
|
2016-02-24 14:41:25 +00:00
|
|
|
cd ..
|
|
|
|
rm -Rf traefik-library-image/
|
|
|
|
|
|
|
|
echo "Deployed"
|