2017-04-21 09:23:45 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-02-19 11:58:06 +00:00
|
|
|
set -e
|
|
|
|
|
2017-05-16 15:24:08 +00:00
|
|
|
if [ -n "$TRAVIS_TAG" ]; 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
|
|
|
|
|
2017-08-28 09:48:03 +00:00
|
|
|
git config --global user.email "$TRAEFIKER_EMAIL"
|
|
|
|
git config --global user.name "Traefiker"
|
2016-04-06 16:43:27 +00:00
|
|
|
|
2016-04-05 18:47:38 +00:00
|
|
|
# load ssh key
|
2016-04-05 18:47:23 +00:00
|
|
|
echo "Loading key..."
|
2017-08-28 09:48:03 +00:00
|
|
|
openssl aes-256-cbc -K $encrypted_f9e835a425bc_key -iv $encrypted_f9e835a425bc_iv -in .travis/traefiker_rsa.enc -out ~/.ssh/traefiker_rsa -d
|
2016-04-05 18:47:23 +00:00
|
|
|
eval "$(ssh-agent -s)"
|
2017-08-28 09:48:03 +00:00
|
|
|
chmod 600 ~/.ssh/traefiker_rsa
|
|
|
|
ssh-add ~/.ssh/traefiker_rsa
|
2016-04-05 18:47:23 +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..."
|
2017-06-27 20:56:19 +00:00
|
|
|
docker login -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/
|
|
|
|
|
2017-08-28 09:48:03 +00:00
|
|
|
echo "Deployed"
|