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

Commit cdf1dbb

Browse files
Bot Updating Templated Files
1 parent cd2f68a commit cdf1dbb

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
@@ -35,7 +35,7 @@ pipeline {
3535
script{
3636
env.EXIT_STATUS = ''
3737
env.LS_RELEASE = sh(
38-
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' ''',
38+
script: '''docker run --rm alexeiled/skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':5.9 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''',
3939
returnStdout: true).trim()
4040
env.LS_RELEASE_NOTES = sh(
4141
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' ''',
@@ -230,7 +230,7 @@ pipeline {
230230
fi
231231
mkdir -p ${TEMPDIR}/gitbook
232232
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
233-
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
233+
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
234234
cp ${TEMPDIR}/${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
235235
cd ${TEMPDIR}/gitbook/docker-documentation/
236236
git add images/docker-${CONTAINER_NAME}.md
@@ -305,15 +305,13 @@ pipeline {
305305
sh '''#! /bin/bash
306306
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
307307
'''
308-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-arm-static -o qemu-arm-static"
309-
sh "chmod +x qemu-*"
310308
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
311309
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
312310
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
313311
sh "docker push lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
314312
sh '''docker rmi \
315313
${IMAGE}:arm32v7-${META_TAG} \
316-
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} '''
314+
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
317315
}
318316
}
319317
}
@@ -334,15 +332,13 @@ pipeline {
334332
sh '''#! /bin/bash
335333
echo $DOCKERPASS | docker login -u $DOCKERUSER --password-stdin
336334
'''
337-
sh "curl https://lsio-ci.ams3.digitaloceanspaces.com/qemu-aarch64-static -o qemu-aarch64-static"
338-
sh "chmod +x qemu-*"
339335
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
340336
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
341337
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
342338
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
343339
sh '''docker rmi \
344340
${IMAGE}:arm64v8-${META_TAG} \
345-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
341+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
346342
}
347343
}
348344
}
@@ -506,7 +502,7 @@ pipeline {
506502
sh "docker push ${IMAGE}:${META_TAG}"
507503
sh '''docker rmi \
508504
${IMAGE}:${META_TAG} \
509-
${IMAGE}:5.9 '''
505+
${IMAGE}:5.9 || :'''
510506

511507
}
512508
}
@@ -563,7 +559,7 @@ pipeline {
563559
${IMAGE}:arm64v8-${META_TAG} \
564560
${IMAGE}:arm64v8-5.9 \
565561
lsiodev/buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
566-
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
562+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} || :'''
567563
}
568564
}
569565
}
@@ -572,25 +568,25 @@ pipeline {
572568
when {
573569
branch "5.9"
574570
expression {
575-
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-ls' + env.LS_TAG_NUMBER
571+
env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
576572
}
577573
environment name: 'CHANGE_ID', value: ''
578574
environment name: 'EXIT_STATUS', value: ''
579575
}
580576
steps {
581-
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-pkg-${PACKAGE_TAG}-ls${LS_TAG_NUMBER}"
577+
echo "Pushing New tag for current commit ${EXT_RELEASE_CLEAN}-ls${LS_TAG_NUMBER}"
582578
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \
583-
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
579+
-d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
584580
"object": "'${COMMIT_SHA}'",\
585-
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}' to 5.9",\
581+
"message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to 5.9",\
586582
"type": "commit",\
587583
"tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' '''
588584
echo "Pushing New release for Tag"
589585
sh '''#! /bin/bash
590586
echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json
591-
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
587+
echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
592588
"target_commitish": "5.9",\
593-
"name": "'${EXT_RELEASE_CLEAN}'-pkg-'${PACKAGE_TAG}'-ls'${LS_TAG_NUMBER}'",\
589+
"name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\
594590
"body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**Remote Changes:**\\n\\n' > start
595591
printf '","draft": false,"prerelease": true}' >> releasebody.json
596592
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
@@ -184,22 +184,42 @@ Below are the instructions for updating containers:
184184
* Start the new container: `docker start unifi-controller`
185185
* You can also remove the old dangling images: `docker image prune`
186186

187-
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
188-
* Pull the latest image at its tag and replace it with the same env variables in one shot:
189-
```
190-
docker run --rm \
191-
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
192-
--oneshot unifi-controller
193-
```
194-
* You can also remove the old dangling images: `docker image prune`
195-
196187
### Via Docker Compose
197188
* Update all images: `docker-compose pull`
198189
* or update a single image: `docker-compose pull unifi-controller`
199190
* Let compose update all containers as necessary: `docker-compose up -d`
200191
* or update a single container: `docker-compose up -d unifi-controller`
201192
* You can also remove the old dangling images: `docker image prune`
202193

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

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

0 commit comments

Comments
 (0)