traefik/script/deploy.sh

37 lines
1,021 B
Bash
Raw Normal View History

#!/usr/bin/env bash
set -e
if [ -n "$TRAVIS_TAG" ]; then
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"
# load ssh key
2021-02-26 13:34:04 +00:00
: "${encrypted_83c521e11abe_key:?}" # ensures variable is defined
: "${encrypted_83c521e11abe_iv:?}" # same
echo "Loading key..."
2021-02-26 13:34:04 +00:00
openssl aes-256-cbc -K "$encrypted_83c521e11abe_key" -iv "$encrypted_83c521e11abe_iv" -in .travis/traefiker_rsa.enc -out ~/.ssh/traefiker_rsa -d
eval "$(ssh-agent -s)"
2017-08-28 09:48:03 +00:00
chmod 600 ~/.ssh/traefiker_rsa
ssh-add ~/.ssh/traefiker_rsa
# update traefik-library-image repo (official Docker image)
echo "Updating traefik-library-imag repo..."
git clone git@github.com:traefik/traefik-library-image.git
2019-06-17 21:40:05 +00:00
cd traefik-library-image
2021-02-26 13:34:04 +00:00
./updatev2.sh "$VERSION"
git add -A
2021-02-26 13:34:04 +00:00
echo "$VERSION" | git commit --file -
echo "$VERSION" | git tag -a "$VERSION" --file -
git push -q --follow-tags -u origin master > /dev/null 2>&1
2019-06-17 21:40:05 +00:00
cd ..
rm -Rf traefik-library-image/
echo "Deployed"