2019-08-18 10:45:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
echo "Switch back to master"
|
|
|
|
git checkout master
|
|
|
|
git reset --hard origin/master
|
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
version=$(curl -s "https://lv.luzifer.io/catalog-api/yggdrasil/latest.txt?p=version")
|
2019-09-28 11:42:45 +00:00
|
|
|
grep -q "YGGDRASIL_VERSION=${version}" Dockerfile && exit 0 || echo "Update required"
|
2019-08-18 10:45:01 +00:00
|
|
|
|
|
|
|
sed -Ei \
|
|
|
|
-e "s/YGGDRASIL_VERSION=[0-9.]+/YGGDRASIL_VERSION=${version}/" \
|
|
|
|
Dockerfile
|
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
echo "Testing build..."
|
|
|
|
docker build .
|
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
echo "Updating repository..."
|
|
|
|
git add Dockerfile
|
|
|
|
git -c user.name='Travis Automated Update' -c user.email='travis@luzifer.io' \
|
|
|
|
commit -m "Yggdrasil ${version}"
|
|
|
|
git tag v${version}
|
|
|
|
|
|
|
|
git push -q https://${GH_USER}:${GH_TOKEN}@github.com/luzifer-docker/yggdrasil master --tags
|