2017-04-21 12:23:45 +03:00
#!/usr/bin/env bash
2016-02-19 14:58:06 +03:00
set -e
2017-05-16 18:24:08 +03:00
if [ -n " $TRAVIS_TAG " ] ; then
2016-04-05 21:47:23 +03:00
echo "Deploying..."
2016-02-22 17:01:00 +03:00
else
echo "Skipping deploy"
exit 0
fi
2016-04-06 19:43:27 +03:00
git config --global user.email "emile@vauge.com"
git config --global user.name "Emile Vauge"
2016-04-05 21:47:38 +03:00
# load ssh key
2016-04-05 21:47:23 +03:00
echo "Loading key..."
2016-04-06 16:28:25 +03:00
openssl aes-256-cbc -d -k " $pass " -in .travis/traefik.id_rsa.enc -out ~/.ssh/traefik.id_rsa
2016-04-05 21:47:23 +03:00
eval " $( ssh-agent -s) "
chmod 600 ~/.ssh/traefik.id_rsa
ssh-add ~/.ssh/traefik.id_rsa
2016-02-24 17:41:25 +03:00
# update traefik-library-image repo (official Docker image)
2016-04-05 21:47:23 +03:00
echo "Updating traefik-library-imag repo..."
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-06 19:43:27 +03:00
git push -q --follow-tags -u origin master > /dev/null 2>& 1
2016-02-24 18:43:39 +03:00
# create docker image emilevauge/traefik (compatibility)
2016-04-05 21:47:23 +03:00
echo "Updating docker emilevauge/traefik image..."
2017-06-27 23:56:19 +03:00
docker login -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"