mirror of
https://github.com/luzifer-docker/openfire.git
synced 2024-12-20 12:11:19 +00:00
Add update-script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
beb2142fa8
commit
d73ff19fd5
2 changed files with 49 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
|
42
update.sh
Executable file
42
update.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/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/openfire/latest.txt?p=version")
|
||||
versionVar=$(echo "${version}" | sed 's/\./_/g')
|
||||
grep -q "OPENFIRE_VERSION=${versionVar} " Dockerfile && exit 0 || echo "Update required"
|
||||
|
||||
sed -Ei \
|
||||
-e "s/OPENFIRE_VERSION=[0-9_]+/OPENFIRE_VERSION=${versionVar}/" \
|
||||
Dockerfile
|
||||
|
||||
### ---- ###
|
||||
|
||||
echo "Testing image build and run..."
|
||||
|
||||
function cleanup() {
|
||||
docker rm -f luzifer-openfire
|
||||
}
|
||||
|
||||
docker run -d --name luzifer-openfire $(docker build -q .)
|
||||
trap cleanup EXIT
|
||||
|
||||
sleep 5 # Container needs a moment to spin up
|
||||
docker exec -ti luzifer-openfire sh -exc 'apk --no-cache add curl && curl -sL localhost:9090/index.jsp | grep -q "Openfire Setup"'
|
||||
|
||||
### ---- ###
|
||||
|
||||
echo "Updating repository..."
|
||||
git add Dockerfile
|
||||
git -c user.name='Travis Automated Update' -c user.email='travis@luzifer.io' \
|
||||
commit -m "Openfire ${version}"
|
||||
git tag ${version}
|
||||
|
||||
git push -q https://${GH_USER}:${GH_TOKEN}@github.com/luzifer-docker/openfire master --tags
|
Loading…
Reference in a new issue