Skip to content

Commit ddbacf0

Browse files
Bot Updating Templated Files
1 parent 3354959 commit ddbacf0

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
@@ -37,7 +37,7 @@ pipeline {
3737
script{
3838
env.EXIT_STATUS = ''
3939
env.LS_RELEASE = sh(
40-
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/latest | jq -r '. | .tag_name' ''',
40+
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' || : ''',
4141
returnStdout: true).trim()
4242
env.LS_RELEASE_NOTES = sh(
4343
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' ''',
@@ -232,7 +232,7 @@ pipeline {
232232
fi
233233
mkdir -p ${TEMPDIR}/gitbook
234234
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
235-
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
235+
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
236236
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
237237
cd ${TEMPDIR}/gitbook/docker-documentation/
238238
git add images/docker-${CONTAINER_NAME}.md
@@ -307,15 +307,13 @@ pipeline {
307307
sh '''#! /bin/bash
308308
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
309309
'''
310-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
311-
sh "chmod +x qemu-*"
312310
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
313311
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
314312
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
315313
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
316314
sh '''docker rmi \
317315
${IMAGE}:arm32v7-${META_TAG} \
318-
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
316+
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
319317
}
320318
}
321319
}
@@ -336,15 +334,13 @@ pipeline {
336334
sh '''#! /bin/bash
337335
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
338336
'''
339-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
340-
sh "chmod +x qemu-*"
341337
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
342338
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
343339
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
344340
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
345341
sh '''docker rmi \
346342
${IMAGE}:arm64v8-${META_TAG} \
347-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
343+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
348344
}
349345
}
350346
}
@@ -508,7 +504,7 @@ pipeline {
508504
sh "docker push ${IMAGE}:${META_TAG}"
509505
sh '''docker rmi \
510506
${IMAGE}:${META_TAG} \
511-
${IMAGE}:latest '''
507+
${IMAGE}:latest || :'''
512508

513509
}
514510
}
@@ -565,7 +561,7 @@ pipeline {
565561
${IMAGE}:arm64v8-${META_TAG} \
566562
${IMAGE}:arm64v8-latest \
567563
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
568-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
564+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
569565
}
570566
}
571567
}
@@ -574,25 +570,25 @@ pipeline {
574570
when {
575571
branch "master"
576572
expression {
577-
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
573+
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
578574
}
579575
environment name: 'CHANGE_ID', value: ''
580576
environment name: 'EXIT_STATUS', value: ''
581577
}
582578
steps {
583-
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-pkg-${PACKAGE_TAG}-ls${LS_TAG_NUMBER}"
579+
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
584580
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
585-
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
581+
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
586582
"object": "'${COMMIT_SHA}'",\
587-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to master",\
583+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
588584
"type": "commit",\
589585
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
590586
echo "Pushing New release for Tag"
591587
sh '''#! /bin/bash
592588
echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json
593-
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
589+
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
594590
"target_commitish": "master",\
595-
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
591+
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
596592
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
597593
printf '","draft": false,"prerelease": false}' >> releasebody.json
598594
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
@@ -152,22 +152,42 @@ Below are the instructions for updating containers:
152152
* Start the new container: `docker start duplicati`
153153
* You can also remove the old dangling images: `docker image prune`
154154

155-
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
156-
* Pull the latest image at its tag and replace it with the same env variables in one shot:
157-
```
158-
docker run --rm \
159-
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
160-
--oneshot duplicati
161-
```
162-
* You can also remove the old dangling images: `docker image prune`
163-
164155
### Via Docker Compose
165156
* Update all images: `docker-compose pull`
166157
* or update a single image: `docker-compose pull duplicati`
167158
* Let compose update all containers as necessary: `docker-compose up -d`
168159
* or update a single container: `docker-compose up -d duplicati`
169160
* You can also remove the old dangling images: `docker image prune`
170161

162+
### Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
163+
* Pull the latest image at its tag and replace it with the same env variables in one run:
164+
```
165+
docker run --rm \
166+
-v /var/run/docker.sock:/var/run/docker.sock \
167+
containrrr/watchtower \
168+
--run-once duplicati
169+
```
170+
* You can also remove the old dangling images: `docker image prune`
171+
172+
## Building locally
173+
174+
If you want to make local modifications to these images for development purposes or just to customize the logic:
175+
```
176+
git clone https://github.com/linuxserver/docker-duplicati.git
177+
cd docker-duplicati
178+
docker build \
179+
--no-cache \
180+
--pull \
181+
-t linuxserver/duplicati:latest .
182+
```
183+
184+
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
185+
```
186+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
187+
```
188+
189+
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
190+
171191
## Versions
172192

173193
* **23.03.19:** - Switching to new Base images, shift to arm32v7 tag.

0 commit comments

Comments
 (0)