Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit cc991b5

Browse files
Bot Updating Templated Files
1 parent 793330d commit cc991b5

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

Jenkinsfile

+12-16
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/latest | jq -r '. | .tag_name' ''',
41+
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 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}:latest '''
515+
${IMAGE}:latest || :'''
520516

521517
}
522518
}
@@ -573,7 +569,7 @@ pipeline {
573569
${IMAGE}:arm64v8-${META_TAG} \
574570
${IMAGE}:arm64v8-latest \
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 "master"
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 master",\
591+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
596592
"type": "commit",\
597593
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","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": "master",\
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": false}' >> releasebody.json
606602
paste -d'\\0' start releasebody.json > releasebody.json.done

README.md

+29-9
Original file line numberDiff line numberDiff line change
@@ -176,22 +176,42 @@ Below are the instructions for updating containers:
176176
* Start the new container: `docker start kanzi`
177177
* You can also remove the old dangling images: `docker image prune`
178178

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

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

197217
* **13.04.19:** - Initial Release.

0 commit comments

Comments
 (0)