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

Commit 444e3b0

Browse files
Bot Updating Templated Files
1 parent 1015482 commit 444e3b0

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
@@ -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: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Here are some example snippets to help you get started creating a container.
6262
```
6363
docker create \
6464
--name=domoticz \
65-
-e PUID=1001 \
66-
-e PGID=1001 \
65+
-e PUID=1000 \
66+
-e PGID=1000 \
6767
-e TZ=Europe/London \
6868
-p 8080:8080 \
6969
-p 6144:6144 \
@@ -99,8 +99,8 @@ services:
9999
image: linuxserver/domoticz
100100
container_name: domoticz
101101
environment:
102-
- PUID=1001
103-
- PGID=1001
102+
- PUID=1000
103+
- PGID=1000
104104
- TZ=Europe/London
105105
volumes:
106106
- <path to data>:/config
@@ -110,7 +110,6 @@ services:
110110
- 1443:1443
111111
devices:
112112
- <path to device>:<path to device>
113-
mem_limit: 4096m
114113
restart: unless-stopped
115114
```
116115

@@ -123,8 +122,8 @@ Container images are configured using parameters passed at runtime (such as thos
123122
| `-p 8080` | WebUI |
124123
| `-p 6144` | Domoticz communication port. |
125124
| `-p 1443` | Domoticz communication port. |
126-
| `-e PUID=1001` | for UserID - see below for explanation |
127-
| `-e PGID=1001` | for GroupID - see below for explanation |
125+
| `-e PUID=1000` | for UserID - see below for explanation |
126+
| `-e PGID=1000` | for GroupID - see below for explanation |
128127
| `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. |
129128
| `-v /config` | Where Domoticz stores config files and data. |
130129
| `--device <path to device>` | For passing through USB devices. |
@@ -135,11 +134,11 @@ When using volumes (`-v` flags) permissions issues can arise between the host OS
135134

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

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

140139
```
141140
$ id username
142-
uid=1001(dockeruser) gid=1001(dockergroup) groups=1001(dockergroup)
141+
uid=1000(dockeruser) gid=1000(dockergroup) groups=1000(dockergroup)
143142
```
144143

145144

@@ -174,9 +173,20 @@ Below are the instructions for updating containers:
174173
* Start the new container: `docker start domoticz`
175174
* You can also remove the old dangling images: `docker image prune`
176175

176+
### Via Taisun auto-updater (especially useful if you don't remember the original parameters)
177+
* Pull the latest image at its tag and replace it with the same env variables in one shot:
178+
```
179+
docker run --rm \
180+
-v /var/run/docker.sock:/var/run/docker.sock taisun/updater \
181+
--oneshot domoticz
182+
```
183+
* You can also remove the old dangling images: `docker image prune`
184+
177185
### Via Docker Compose
178-
* Update the image: `docker-compose pull linuxserver/domoticz`
179-
* Let compose update containers as necessary: `docker-compose up -d`
186+
* Update all images: `docker-compose pull`
187+
* or update a single image: `docker-compose pull domoticz`
188+
* Let compose update all containers as necessary: `docker-compose up -d`
189+
* or update a single container: `docker-compose up -d domoticz`
180190
* You can also remove the old dangling images: `docker image prune`
181191

182192
## Versions

0 commit comments

Comments
 (0)