mirror of
https://github.com/luzifer-docker/yggdrasil.git
synced 2024-12-21 00:01:16 +00:00
Add auto-update
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c80c0fea66
commit
7166f59fe0
2 changed files with 39 additions and 0 deletions
7
.travis.yml
Normal file
7
.travis.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
sudo: required
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
script:
|
||||||
|
- bash update.sh
|
32
update.sh
Executable file
32
update.sh
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/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")
|
||||||
|
grep -q "YGGDRASIL_VERSION=${version} " Dockerfile && exit 0 || echo "Update required"
|
||||||
|
|
||||||
|
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
|
Loading…
Reference in a new issue