Skip to content

Commit a3a3898

Browse files
Bot Updating Templated Files
1 parent 5344bd9 commit a3a3898

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' ''',
@@ -231,7 +231,7 @@ pipeline {
231231
fi
232232
mkdir -p ${TEMPDIR}/gitbook
233233
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
234-
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
234+
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
235235
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
236236
cd ${TEMPDIR}/gitbook/docker-documentation/
237237
git add images/docker-${CONTAINER_NAME}.md
@@ -306,15 +306,13 @@ pipeline {
306306
sh '''#! /bin/bash
307307
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
308308
'''
309-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
310-
sh "chmod +x qemu-*"
311309
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
312310
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
313311
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
314312
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
315313
sh '''docker rmi \
316314
${IMAGE}:arm32v7-${META_TAG} \
317-
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
315+
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
318316
}
319317
}
320318
}
@@ -335,15 +333,13 @@ pipeline {
335333
sh '''#! /bin/bash
336334
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
337335
'''
338-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
339-
sh "chmod +x qemu-*"
340336
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
341337
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
342338
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
343339
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
344340
sh '''docker rmi \
345341
${IMAGE}:arm64v8-${META_TAG} \
346-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
342+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
347343
}
348344
}
349345
}
@@ -507,7 +503,7 @@ pipeline {
507503
sh "docker push ${IMAGE}:${META_TAG}"
508504
sh '''docker rmi \
509505
${IMAGE}:${META_TAG} \
510-
${IMAGE}:latest '''
506+
${IMAGE}:latest || :'''
511507

512508
}
513509
}
@@ -564,7 +560,7 @@ pipeline {
564560
${IMAGE}:arm64v8-${META_TAG} \
565561
${IMAGE}:arm64v8-latest \
566562
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
567-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
563+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
568564
}
569565
}
570566
}
@@ -573,25 +569,25 @@ pipeline {
573569
when {
574570
branch "master"
575571
expression {
576-
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
572+
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
577573
}
578574
environment name: 'CHANGE_ID', value: ''
579575
environment name: 'EXIT_STATUS', value: ''
580576
}
581577
steps {
582-
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-pkg-${PACKAGE_TAG}-ls${LS_TAG_NUMBER}"
578+
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
583579
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
584-
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
580+
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
585581
"object": "'${COMMIT_SHA}'",\
586-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to master",\
582+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\
587583
"type": "commit",\
588584
"tagger": {"name": "LinuxServer Jenkins","email": "[email protected]","date": "'${GITHUB_DATE}'"}}' '''
589585
echo "Pushing New release for Tag"
590586
sh '''#! /bin/bash
591587
echo "Updating PIP version of ${EXT_PIP} to ${EXT_RELEASE_CLEAN}" > releasebody.json
592-
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
588+
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
593589
"target_commitish": "master",\
594-
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
590+
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
595591
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**PIP Changes:**\\n\\n' > start
596592
printf '","draft": false,"prerelease": false}' >> releasebody.json
597593
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
@@ -119,22 +119,42 @@ Below are the instructions for updating containers:
119119
* Start the new container: `docker start ldap-auth`
120120
* You can also remove the old dangling images: `docker image prune`
121121

122-
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
123-
* Pull the latest image at its tag and replace it with the same env variables in one shot:
124-
```
125-
docker run --rm \
126-
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
127-
--oneshot ldap-auth
128-
```
129-
* You can also remove the old dangling images: `docker image prune`
130-
131122
### Via Docker Compose
132123
* Update all images: `docker-compose pull`
133124
* or update a single image: `docker-compose pull ldap-auth`
134125
* Let compose update all containers as necessary: `docker-compose up -d`
135126
* or update a single container: `docker-compose up -d ldap-auth`
136127
* You can also remove the old dangling images: `docker image prune`
137128

129+
### Via Watchtower auto-updater (especially useful if you don't remember the original parameters)
130+
* Pull the latest image at its tag and replace it with the same env variables in one run:
131+
```
132+
docker run --rm \
133+
-v /var/run/docker.sock:/var/run/docker.sock \
134+
containrrr/watchtower \
135+
--run-once ldap-auth
136+
```
137+
* You can also remove the old dangling images: `docker image prune`
138+
139+
## Building locally
140+
141+
If you want to make local modifications to these images for development purposes or just to customize the logic:
142+
```
143+
git clone https://github.com/linuxserver/docker-ldap-auth.git
144+
cd docker-ldap-auth
145+
docker build \
146+
--no-cache \
147+
--pull \
148+
-t linuxserver/ldap-auth:latest .
149+
```
150+
151+
The ARM variants can be built on x86_64 hardware using `multiarch/qemu-user-static`
152+
```
153+
docker run --rm --privileged multiarch/qemu-user-static:register --reset
154+
```
155+
156+
Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64`.
157+
138158
## Versions
139159

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

0 commit comments

Comments
 (0)