Skip to content

Commit 042498f

Browse files
Bot Updating Templated Files
1 parent d7784be commit 042498f

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": "jenkins@linuxserver.io","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
@@ -192,22 +192,42 @@ Below are the instructions for updating containers:
192192
* Start the new container: `docker start plex`
193193
* You can also remove the old dangling images: `docker image prune`
194194

195-
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
196-
* Pull the latest image at its tag and replace it with the same env variables in one shot:
197-
```
198-
docker run --rm \
199-
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
200-
--oneshot plex
201-
```
202-
* You can also remove the old dangling images: `docker image prune`
203-
204195
### Via Docker Compose
205196
* Update all images: `docker-compose pull`
206197
* or update a single image: `docker-compose pull plex`
207198
* Let compose update all containers as necessary: `docker-compose up -d`
208199
* or update a single container: `docker-compose up -d plex`
209200
* You can also remove the old dangling images: `docker image prune`
210201

202+
### Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
203+
* Pull the latest image at its tag and replace it with the same env variables in one run:
204+
```
205+
docker run --rm \
206+
-v /var/run/docker.sock:/var/run/docker.sock \
207+
containrrr/watchtower
208+
--run-once plex
209+
```
210+
* You can also remove the old dangling images: `docker image prune`
211+
212+
## Building locally
213+
214+
If you want to make local modifications to these images for development purposes or just to customize the logic:
215+
```
216+
git clone https://github.com/linuxserver/docker-plex.git
217+
cd docker-plex
218+
docker build \
219+
--no-cache \
220+
--pull \
221+
-t linuxserver/plex:latest .
222+
```
223+
224+
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
225+
```
226+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
227+
```
228+
229+
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
230+
211231
## Versions
212232

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

0 commit comments

Comments
 (0)