mirror of
https://github.com/luzifer-docker/wordpress.git
synced 2024-12-20 23:21:18 +00:00
Improve auto-update
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
9b6183ac33
commit
3907c3c1db
2 changed files with 31 additions and 1 deletions
7
.travis.yml
Normal file
7
.travis.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
sudo: required
|
||||||
|
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
|
||||||
|
script:
|
||||||
|
- bash update.sh
|
25
update.sh
25
update.sh
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
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/wordpress/latest.txt?p=version")
|
version=$(curl -s "https://lv.luzifer.io/catalog-api/wordpress/latest.txt?p=version")
|
||||||
grep -q "WP_VERSION=${version} " Dockerfile && exit 0 || echo "Update required"
|
grep -q "WP_VERSION=${version} " Dockerfile && exit 0 || echo "Update required"
|
||||||
|
@ -10,3 +18,18 @@ sed -Ei \
|
||||||
-e "s/WP_VERSION=[0-9.]+/WP_VERSION=${version}/" \
|
-e "s/WP_VERSION=[0-9.]+/WP_VERSION=${version}/" \
|
||||||
-e "s/WP_CHECKSUM=[a-z0-9]+/WP_CHECKSUM=${wphash}/" \
|
-e "s/WP_CHECKSUM=[a-z0-9]+/WP_CHECKSUM=${wphash}/" \
|
||||||
Dockerfile
|
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 "WordPress ${version}"
|
||||||
|
git tag ${version}
|
||||||
|
|
||||||
|
git push -q https://${GH_USER}:${GH_TOKEN}@github.com/luzifer-docker/wordpress master --tags
|
||||||
|
|
Loading…
Reference in a new issue