Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit 8ea476c

Browse files
Bot Updating Templated Files
1 parent 4514dd3 commit 8ea476c

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

Jenkinsfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pipeline {
3838
script{
3939
env.EXIT_STATUS = ''
4040
env.LS_RELEASE = sh(
41-
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' ''',
41+
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':stable 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
4242
returnStdout: true).trim()
4343
env.LS_RELEASE_NOTES = sh(
4444
script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
@@ -240,7 +240,7 @@ pipeline {
240240
fi
241241
mkdir -p ${TEMPDIR}/gitbook
242242
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
243-
if [ "${BRANCH_NAME}" = "master" ] && [ ! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md ] || [ "$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" ]; then
243+
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
244244
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
245245
cd ${TEMPDIR}/gitbook/docker-documentation/
246246
git add images/docker-${CONTAINER_NAME}.md
@@ -315,15 +315,13 @@ pipeline {
315315
sh '''#! /bin/bash
316316
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
317317
'''
318-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
319-
sh "chmod +x qemu-*"
320318
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
321319
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
322320
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
323321
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
324322
sh '''docker rmi \
325323
${IMAGE}:arm32v7-${META_TAG} \
326-
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
324+
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
327325
}
328326
}
329327
}
@@ -344,15 +342,13 @@ pipeline {
344342
sh '''#! /bin/bash
345343
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
346344
'''
347-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
348-
sh "chmod +x qemu-*"
349345
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
350346
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
351347
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
352348
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
353349
sh '''docker rmi \
354350
${IMAGE}:arm64v8-${META_TAG} \
355-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
351+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
356352
}
357353
}
358354
}
@@ -516,7 +512,7 @@ pipeline {
516512
sh "docker push ${IMAGE}:${META_TAG}"
517513
sh '''docker rmi \
518514
${IMAGE}:${META_TAG} \
519-
${IMAGE}:stable '''
515+
${IMAGE}:stable || :'''
520516

521517
}
522518
}
@@ -573,7 +569,7 @@ pipeline {
573569
${IMAGE}:arm64v8-${META_TAG} \
574570
${IMAGE}:arm64v8-stable \
575571
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
576-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
572+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
577573
}
578574
}
579575
}
@@ -582,25 +578,25 @@ pipeline {
582578
when {
583579
branch "stable"
584580
expression {
585-
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
581+
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
586582
}
587583
environment name: 'CHANGE_ID', value: ''
588584
environment name: 'EXIT_STATUS', value: ''
589585
}
590586
steps {
591-
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-pkg-${PACKAGE_TAG}-ls${LS_TAG_NUMBER}"
587+
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
592588
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
593-
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
589+
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
594590
"object": "'${COMMIT_SHA}'",\
595-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to stable",\
591+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to stable",\
596592
"type": "commit",\
597593
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
598594
echo "Pushing New release for Tag"
599595
sh '''#! /bin/bash
600596
curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json
601-
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
597+
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
602598
"target_commitish": "stable",\
603-
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
599+
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
604600
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start
605601
printf '","draft": false,"prerelease": true}' >> releasebody.json
606602
paste -d'\\0' start releasebody.json > releasebody.json.done

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,22 +175,42 @@ Below are the instructions for updating containers:
175175
* Start the new container: `docker start domoticz`
176176
* You can also remove the old dangling images: `docker image prune`
177177

178-
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
179-
* Pull the latest image at its tag and replace it with the same env variables in one shot:
180-
```
181-
docker run --rm \
182-
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
183-
--oneshot domoticz
184-
```
185-
* You can also remove the old dangling images: `docker image prune`
186-
187178
### Via Docker Compose
188179
* Update all images: `docker-compose pull`
189180
* or update a single image: `docker-compose pull domoticz`
190181
* Let compose update all containers as necessary: `docker-compose up -d`
191182
* or update a single container: `docker-compose up -d domoticz`
192183
* You can also remove the old dangling images: `docker image prune`
193184

185+
### Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
186+
* Pull the latest image at its tag and replace it with the same env variables in one run:
187+
```
188+
docker run --rm \
189+
-v /var/run/docker.sock:/var/run/docker.sock \
190+
containrrr/watchtower \
191+
--run-once domoticz
192+
```
193+
* You can also remove the old dangling images: `docker image prune`
194+
195+
## Building locally
196+
197+
If you want to make local modifications to these images for development purposes or just to customize the logic:
198+
```
199+
git clone https://github.com/linuxserver/docker-domoticz.git
200+
cd docker-domoticz
201+
docker build \
202+
--no-cache \
203+
--pull \
204+
-t linuxserver/domoticz:latest .
205+
```
206+
207+
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
208+
```
209+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
210+
```
211+
212+
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
213+
194214
## Versions
195215

196216
* **30.03.19:** - Add env variable to set webroot.

0 commit comments

Comments
 (0)