2019-05-11 19:20:19 +00:00
|
|
|
#!/bin/bash
|
2019-06-09 09:22:19 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
echo "Switch back to master"
|
|
|
|
git checkout master
|
|
|
|
git reset --hard origin/master
|
|
|
|
|
|
|
|
### ---- ###
|
2019-05-11 19:20:19 +00:00
|
|
|
|
2021-12-02 00:24:04 +00:00
|
|
|
version=$(curl -s "https://lv.luzifer.io/v1/catalog/wordpress/latest/version")
|
2019-05-11 19:20:19 +00:00
|
|
|
grep -q "WP_VERSION=${version} " Dockerfile && exit 0 || echo "Update required"
|
|
|
|
|
|
|
|
wphash=$(curl -sSfL "https://github.com/WordPress/WordPress/archive/${version}.tar.gz" | sha256sum | cut -d ' ' -f 1)
|
|
|
|
|
|
|
|
sed -Ei \
|
|
|
|
-e "s/WP_VERSION=[0-9.]+/WP_VERSION=${version}/" \
|
|
|
|
-e "s/WP_CHECKSUM=[a-z0-9]+/WP_CHECKSUM=${wphash}/" \
|
|
|
|
Dockerfile
|
2019-06-09 09:22:19 +00:00
|
|
|
|
|
|
|
### ---- ###
|
|
|
|
|
|
|
|
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
|