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

Commit dc030ac

Browse files
Bot Updating Templated Files
1 parent c51a74e commit dc030ac

File tree

2 files changed

+54
-19
lines changed

2 files changed

+54
-19
lines changed

Jenkinsfile

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pipeline {
3838
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases | jq -r 'first(.[] | select(.prerelease == true)) | .tag_name' ''',
3939
returnStdout: true).trim()
4040
env.LS_RELEASE_NOTES = sh(
41-
script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
41+
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' ''',
4242
returnStdout: true).trim()
4343
env.GITHUB_DATE = sh(
4444
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
@@ -282,6 +282,9 @@ pipeline {
282282
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
283283
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
284284
sh "docker push lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
285+
sh '''docker rmi \
286+
${IMAGE}:arm32v6-${META_TAG} \
287+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} '''
285288
}
286289
}
287290
}
@@ -308,6 +311,9 @@ pipeline {
308311
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
309312
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
310313
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
314+
sh '''docker rmi \
315+
${IMAGE}:arm64v8-${META_TAG} \
316+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
311317
}
312318
}
313319
}
@@ -469,6 +475,10 @@ pipeline {
469475
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:5.8"
470476
sh "docker push ${IMAGE}:5.8"
471477
sh "docker push ${IMAGE}:${META_TAG}"
478+
sh '''docker rmi \
479+
${IMAGE}:${META_TAG} \
480+
${IMAGE}:5.8 '''
481+
472482
}
473483
}
474484
}
@@ -516,6 +526,15 @@ pipeline {
516526
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
517527
sh "docker manifest push --purge ${IMAGE}:5.8"
518528
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
529+
sh '''docker rmi \
530+
${IMAGE}:amd64-${META_TAG} \
531+
${IMAGE}:amd64-5.8 \
532+
${IMAGE}:arm32v6-${META_TAG} \
533+
${IMAGE}:arm32v6-5.8 \
534+
${IMAGE}:arm64v8-${META_TAG} \
535+
${IMAGE}:arm64v8-5.8 \
536+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} \
537+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
519538
}
520539
}
521540
}
@@ -576,6 +595,18 @@ pipeline {
576595
}
577596
}
578597
}
598+
// If this is a Pull request send the CI link as a comment on it
599+
stage('Pull Request Comment') {
600+
when {
601+
not {environment name: 'CHANGE_ID', value: ''}
602+
environment name: 'CI', value: 'true'
603+
environment name: 'EXIT_STATUS', value: ''
604+
}
605+
steps {
606+
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \
607+
-d '{"body": "I am a bot, here are the test results for this PR '${CI_URL}'"}' '''
608+
}
609+
}
579610
}
580611
/* ######################
581612
Send status to Discord

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ Find us at:
1414
* [Blog](https://blog.linuxserver.io) - all the things you can do with our containers including How-To guides, opinions and much more!
1515
* [Podcast](https://anchor.fm/linuxserverio) - on hiatus. Coming back soon (late 2018).
1616

17-
# PSA: Changes are happening
18-
19-
From August 2018 onwards, Linuxserver are in the midst of switching to a new CI platform which will enable us to build and release multiple architectures under a single repo. To this end, existing images for `arm64` and `armhf` builds are being deprecated. They are replaced by a manifest file in each container which automatically pulls the correct image for your architecture. You'll also be able to pull based on a specific architecture tag.
20-
21-
TLDR: Multi-arch support is changing from multiple repos to one repo per container image.
22-
2317
# [linuxserver/unifi-controller](https://github.com/linuxserver/docker-unifi-controller)
2418
[![](https://img.shields.io/discord/354974912613449730.svg?logo=discord&label=LSIO%20Discord&style=flat-square)](https://discord.gg/YWrKVTn)
2519
[![](https://images.microbadger.com/badges/version/linuxserver/unifi-controller.svg)](https://microbadger.com/images/linuxserver/unifi-controller "Get your own version badge on microbadger.com")
@@ -36,7 +30,7 @@ The [Unifi-controller](https://www.ubnt.com/enterprise/#unifi) Controller softwa
3630

3731
## Supported Architectures
3832

39-
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list).
33+
Our images support multiple architectures such as `x86-64`, `arm64` and `armhf`. We utilise the docker manifest for multi-platform awareness. More information is available from docker [here](https://github.com/docker/distribution/blob/master/docs/spec/manifest-v2-2.md#manifest-list) and our announcement [here](https://blog.linuxserver.io/2019/02/21/the-lsio-pipeline-project/).
4034

4135
Simply pulling `linuxserver/unifi-controller` should retrieve the correct image for your arch, but you can also pull specific arch images via tags.
4236

@@ -58,8 +52,8 @@ Here are some example snippets to help you get started creating a container.
5852
```
5953
docker create \
6054
--name=unifi-controller \
61-
-e PUID=1001 \
62-
-e PGID=1001 \
55+
-e PUID=1000 \
56+
-e PGID=1000 \
6357
-p 3478:3478/udp \
6458
-p 10001:10001/udp \
6559
-p 8080:8080 \
@@ -101,8 +95,8 @@ services:
10195
image: linuxserver/unifi-controller
10296
container_name: unifi-controller
10397
environment:
104-
- PUID=1001
105-
- PGID=1001
98+
- PUID=1000
99+
- PGID=1000
106100
volumes:
107101
- <path to data>:/config
108102
ports:
@@ -114,7 +108,6 @@ services:
114108
- 8843:8843
115109
- 8880:8880
116110
- 6789:6789
117-
mem_limit: 4096m
118111
restart: unless-stopped
119112
```
120113

@@ -132,8 +125,8 @@ Container images are configured using parameters passed at runtime (such as thos
132125
| `-p 8843` | Unifi communication port |
133126
| `-p 8880` | Unifi communication port |
134127
| `-p 6789` | For throughput test |
135-
| `-e PUID=1001` | for UserID - see below for explanation |
136-
| `-e PGID=1001` | for GroupID - see below for explanation |
128+
| `-e PUID=1000` | for UserID - see below for explanation |
129+
| `-e PGID=1000` | for GroupID - see below for explanation |
137130
| `-v /config` | All Unifi data stored here |
138131

139132
## User / Group Identifiers
@@ -142,11 +135,11 @@ When using volumes (`-v` flags) permissions issues can arise between the host OS
142135

143136
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
144137

145-
In this instance `PUID=1001` and `PGID=1001`, to find yours use `id user` as below:
138+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
146139

147140
```
148141
$ id username
149-
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
142+
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
150143
```
151144

152145

@@ -192,9 +185,20 @@ Below are the instructions for updating containers:
192185
* Start the new container: `docker start unifi-controller`
193186
* You can also remove the old dangling images: `docker image prune`
194187

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

200204
## Versions

0 commit comments

Comments
 (0)