2017-04-21 11:23:45 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-02-19 12:58:06 +01:00
|
|
|
set -e
|
|
|
|
|
2021-07-23 11:00:07 +02:00
|
|
|
if [ -n "${SEMAPHORE_GIT_TAG_NAME}" ]; then
|
2016-04-05 20:47:23 +02:00
|
|
|
echo "Deploying..."
|
2016-02-22 15:01:00 +01:00
|
|
|
else
|
|
|
|
echo "Skipping deploy"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-07-23 11:00:07 +02:00
|
|
|
git config --global user.email "${TRAEFIKER_EMAIL}"
|
2017-08-28 11:48:03 +02:00
|
|
|
git config --global user.name "Traefiker"
|
2016-04-06 18:43:27 +02:00
|
|
|
|
2016-04-05 20:47:38 +02:00
|
|
|
# load ssh key
|
2016-04-05 20:47:23 +02:00
|
|
|
eval "$(ssh-agent -s)"
|
2021-07-23 11:00:07 +02:00
|
|
|
chmod 600 /home/semaphore/.ssh/traefiker_rsa
|
|
|
|
ssh-add /home/semaphore/.ssh/traefiker_rsa
|
2016-04-05 20:47:23 +02:00
|
|
|
|
2016-02-24 15:41:25 +01:00
|
|
|
# update traefik-library-image repo (official Docker image)
|
2016-04-05 20:47:23 +02:00
|
|
|
echo "Updating traefik-library-imag repo..."
|
2020-09-16 15:46:04 +02:00
|
|
|
git clone git@github.com:traefik/traefik-library-image.git
|
2019-06-17 23:40:05 +02:00
|
|
|
cd traefik-library-image
|
2021-07-23 11:00:07 +02:00
|
|
|
./updatev2.sh "${VERSION}"
|
2016-02-24 15:41:25 +01:00
|
|
|
git add -A
|
2021-07-23 11:00:07 +02:00
|
|
|
echo "${VERSION}" | git commit --file -
|
|
|
|
echo "${VERSION}" | git tag -a "${VERSION}" --file -
|
2016-04-06 18:43:27 +02:00
|
|
|
git push -q --follow-tags -u origin master > /dev/null 2>&1
|
2016-02-24 16:43:39 +01:00
|
|
|
|
2019-06-17 23:40:05 +02:00
|
|
|
cd ..
|
2016-02-24 15:41:25 +01:00
|
|
|
rm -Rf traefik-library-image/
|
|
|
|
|
2019-05-10 17:24:06 +02:00
|
|
|
echo "Deployed"
|