Skip to content

Commit 772a4a8

Browse files
Bot Updating Templated Files
1 parent 8984ceb commit 772a4a8

File tree

2 files changed

+53
-12
lines changed

2 files changed

+53
-12
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/latest | jq -r '. | .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' ''',
@@ -283,6 +283,9 @@ pipeline {
283283
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
284284
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
285285
sh "docker push lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
286+
sh '''docker rmi \
287+
${IMAGE}:arm32v6-${META_TAG} \
288+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} '''
286289
}
287290
}
288291
}
@@ -309,6 +312,9 @@ pipeline {
309312
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
310313
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
311314
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
315+
sh '''docker rmi \
316+
${IMAGE}:arm64v8-${META_TAG} \
317+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
312318
}
313319
}
314320
}
@@ -470,6 +476,10 @@ pipeline {
470476
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest"
471477
sh "docker push ${IMAGE}:latest"
472478
sh "docker push ${IMAGE}:${META_TAG}"
479+
sh '''docker rmi \
480+
${IMAGE}:${META_TAG} \
481+
${IMAGE}:latest '''
482+
473483
}
474484
}
475485
}
@@ -517,6 +527,15 @@ pipeline {
517527
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
518528
sh "docker manifest push --purge ${IMAGE}:latest"
519529
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
530+
sh '''docker rmi \
531+
${IMAGE}:amd64-${META_TAG} \
532+
${IMAGE}:amd64-latest \
533+
${IMAGE}:arm32v6-${META_TAG} \
534+
${IMAGE}:arm32v6-latest \
535+
${IMAGE}:arm64v8-${META_TAG} \
536+
${IMAGE}:arm64v8-latest \
537+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} \
538+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
520539
}
521540
}
522541
}
@@ -577,6 +596,18 @@ pipeline {
577596
}
578597
}
579598
}
599+
// If this is a Pull request send the CI link as a comment on it
600+
stage('Pull Request Comment') {
601+
when {
602+
not {environment name: 'CHANGE_ID', value: ''}
603+
environment name: 'CI', value: 'true'
604+
environment name: 'EXIT_STATUS', value: ''
605+
}
606+
steps {
607+
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \
608+
-d '{"body": "I am a bot, here are the test results for this PR '${CI_URL}'"}' '''
609+
}
610+
}
580611
}
581612
/* ######################
582613
Send status to Discord

README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ Here are some example snippets to help you get started creating a container.
5454
```
5555
docker create \
5656
--name=nextcloud \
57-
-e PUID=1001 \
58-
-e PGID=1001 \
57+
-e PUID=1000 \
58+
-e PGID=1000 \
5959
-e TZ=Europe/London \
6060
-p 443:443 \
6161
-v </path/to/appdata>:/config \
@@ -77,15 +77,14 @@ services:
7777
image: linuxserver/nextcloud
7878
container_name: nextcloud
7979
environment:
80-
- PUID=1001
81-
- PGID=1001
80+
- PUID=1000
81+
- PGID=1000
8282
- TZ=Europe/London
8383
volumes:
8484
- </path/to/appdata>:/config
8585
- <path/to/data>:/data
8686
ports:
8787
- 443:443
88-
mem_limit: 4096m
8988
restart: unless-stopped
9089
```
9190

@@ -96,8 +95,8 @@ Container images are configured using parameters passed at runtime (such as thos
9695
| Parameter | Function |
9796
| :----: | --- |
9897
| `-p 443` | WebUI |
99-
| `-e PUID=1001` | for UserID - see below for explanation |
100-
| `-e PGID=1001` | for GroupID - see below for explanation |
98+
| `-e PUID=1000` | for UserID - see below for explanation |
99+
| `-e PGID=1000` | for GroupID - see below for explanation |
101100
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
102101
| `-v /config` | Nextcloud configs. |
103102
| `-v /data` | Your personal data. |
@@ -108,11 +107,11 @@ When using volumes (`-v` flags) permissions issues can arise between the host OS
108107

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

111-
In this instance `PUID=1001` and `PGID=1001`, to find yours use `id user` as below:
110+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
112111

113112
```
114113
$ id username
115-
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
114+
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
116115
```
117116

118117

@@ -152,9 +151,20 @@ Below are the instructions for updating containers:
152151
* Start the new container: `docker start nextcloud`
153152
* You can also remove the old dangling images: `docker image prune`
154153

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

160170
## Versions

0 commit comments

Comments
 (0)