Skip to content

Commit 973c558

Browse files
Bot Updating Templated Files
1 parent e1e953a commit 973c558

2 files changed

Lines changed: 54 additions & 12 deletions

File tree

Jenkinsfile

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pipeline {
4141
script: '''curl -s https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases/latest | jq -r '. | .tag_name' ''',
4242
returnStdout: true).trim()
4343
env.LS_RELEASE_NOTES = sh(
44-
script: '''git log -1 --pretty=%B | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''',
44+
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' ''',
4545
returnStdout: true).trim()
4646
env.GITHUB_DATE = sh(
4747
script: '''date '+%Y-%m-%dT%H:%M:%S%:z' ''',
@@ -292,6 +292,9 @@ pipeline {
292292
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
293293
sh "docker tag ${IMAGE}:arm32v6-${META_TAG} lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
294294
sh "docker push lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER}"
295+
sh '''docker rmi \
296+
${IMAGE}:arm32v6-${META_TAG} \
297+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} '''
295298
}
296299
}
297300
}
@@ -318,6 +321,9 @@ pipeline {
318321
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
319322
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
320323
sh "docker push lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
324+
sh '''docker rmi \
325+
${IMAGE}:arm64v8-${META_TAG} \
326+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
321327
}
322328
}
323329
}
@@ -479,6 +485,10 @@ pipeline {
479485
sh "docker tag ${IMAGE}:${META_TAG} ${IMAGE}:latest"
480486
sh "docker push ${IMAGE}:latest"
481487
sh "docker push ${IMAGE}:${META_TAG}"
488+
sh '''docker rmi \
489+
${IMAGE}:${META_TAG} \
490+
${IMAGE}:latest '''
491+
482492
}
483493
}
484494
}
@@ -526,6 +536,15 @@ pipeline {
526536
sh "docker manifest annotate ${IMAGE}:${META_TAG} ${IMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8"
527537
sh "docker manifest push --purge ${IMAGE}:latest"
528538
sh "docker manifest push --purge ${IMAGE}:${META_TAG}"
539+
sh '''docker rmi \
540+
${IMAGE}:amd64-${META_TAG} \
541+
${IMAGE}:amd64-latest \
542+
${IMAGE}:arm32v6-${META_TAG} \
543+
${IMAGE}:arm32v6-latest \
544+
${IMAGE}:arm64v8-${META_TAG} \
545+
${IMAGE}:arm64v8-latest \
546+
lsiodev/buildcache:arm32v6-${COMMIT_SHA}-${BUILD_NUMBER} \
547+
lsiodev/buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER} '''
529548
}
530549
}
531550
}
@@ -586,6 +605,18 @@ pipeline {
586605
}
587606
}
588607
}
608+
// If this is a Pull request send the CI link as a comment on it
609+
stage('Pull Request Comment') {
610+
when {
611+
not {environment name: 'CHANGE_ID', value: ''}
612+
environment name: 'CI', value: 'true'
613+
environment name: 'EXIT_STATUS', value: ''
614+
}
615+
steps {
616+
sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/issues/${PULL_REQUEST}/comments \
617+
-d '{"body": "I am a bot, here are the test results for this PR '${CI_URL}'"}' '''
618+
}
619+
}
589620
}
590621
/* ######################
591622
Send status to Discord

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Here are some example snippets to help you get started creating a container.
5151
```
5252
docker create \
5353
--name=piwigo \
54-
-e PUID=1001 \
55-
-e PGID=1001 \
54+
-e PUID=1000 \
55+
-e PGID=1000 \
5656
-e TZ=Europe/London \
5757
-p 80:80 \
5858
-v </path/to/appdata/config>:/config \
@@ -73,14 +73,13 @@ services:
7373
image: linuxserver/piwigo
7474
container_name: piwigo
7575
environment:
76-
- PUID=1001
77-
- PGID=1001
76+
- PUID=1000
77+
- PGID=1000
7878
- TZ=Europe/London
7979
volumes:
8080
- </path/to/appdata/config>:/config
8181
ports:
8282
- 80:80
83-
mem_limit: 4096m
8483
restart: unless-stopped
8584
```
8685

@@ -91,8 +90,8 @@ Container images are configured using parameters passed at runtime (such as thos
9190
| Parameter | Function |
9291
| :----: | --- |
9392
| `-p 80` | Application WebUI |
94-
| `-e PUID=1001` | for UserID - see below for explanation |
95-
| `-e PGID=1001` | for GroupID - see below for explanation |
93+
| `-e PUID=1000` | for UserID - see below for explanation |
94+
| `-e PGID=1000` | for GroupID - see below for explanation |
9695
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
9796
| `-v /config` | Configuration files. |
9897

@@ -102,11 +101,11 @@ When using volumes (`-v` flags) permissions issues can arise between the host OS
102101

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

105-
In this instance `PUID=1001` and `PGID=1001`, to find yours use `id user` as below:
104+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
106105

107106
```
108107
$ id username
109-
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
108+
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
110109
```
111110

112111

@@ -143,13 +142,25 @@ Below are the instructions for updating containers:
143142
* Start the new container: `docker start piwigo`
144143
* You can also remove the old dangling images: `docker image prune`
145144

145+
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
146+
* Pull the latest image at its tag and replace it with the same env variables in one shot:
147+
```
148+
docker run --rm \
149+
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
150+
--oneshot piwigo
151+
```
152+
* You can also remove the old dangling images: `docker image prune`
153+
146154
### Via Docker Compose
147-
* Update the image: `docker-compose pull linuxserver/piwigo`
148-
* Let compose update containers as necessary: `docker-compose up -d`
155+
* Update all images: `docker-compose pull`
156+
* or update a single image: `docker-compose pull piwigo`
157+
* Let compose update all containers as necessary: `docker-compose up -d`
158+
* or update a single container: `docker-compose up -d piwigo`
149159
* You can also remove the old dangling images: `docker image prune`
150160

151161
## Versions
152162

163+
* **01.03.19:** - Add php-ctype & php-curl.
153164
* **22.02.19:** - Rebasing to alpine 3.9, add php-ldap.
154165
* **28.01.19:** - Rebase to alpine linux 3.8 , add pipeline logic and multi arch.
155166
* **25.01.18:** - Rebase to alpine linux 3.7.

0 commit comments

Comments
 (0)