Skip to content

Commit 6c7e286

Browse files
Bot Updating Templated Files
1 parent 587be5e commit 6c7e286

File tree

3 files changed

+38
-47
lines changed

3 files changed

+38
-47
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1 @@
1-
[linuxserverurl]: https://linuxserver.io
2-
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
31

4-
<!--- If you are new to Docker or this application our issue tracker is **ONLY** used for reporting bugs or requesting features. Please use [our discord server](https://discord.gg/YWrKVTn) for general support. --->
5-
6-
<!--- If this acts as a feature request please ask yourself if this modification is something the whole userbase will benefit from --->
7-
<!--- If this is a specific change for corner case functionality or plugins please look at making a Docker Mod or local script https://blog.linuxserver.io/2019/09/14/customizing-our-containers/ -->
8-
9-
<!--- Provide a general summary of the issue in the Title above -->
10-
11-
------------------------------
12-
13-
## Expected Behavior
14-
<!--- Tell us what should happen -->
15-
16-
## Current Behavior
17-
<!--- Tell us what happens instead of the expected behavior -->
18-
19-
## Steps to Reproduce
20-
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
21-
<!--- reproduce this bug. Include code to reproduce, if relevant -->
22-
1.
23-
2.
24-
3.
25-
4.
26-
27-
## Environment
28-
**OS:**
29-
**CPU architecture:** x86_64/arm32/arm64
30-
**How docker service was installed:**
31-
<!--- ie. from the official docker repo, from the distro repo, nas OS provided, etc. -->
32-
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
33-
34-
## Command used to create docker container (run/create/compose/screenshot)
35-
<!--- Provide your docker create/run command or compose yaml snippet, or a screenshot of settings if using a gui to create the container -->
36-
37-
## Docker logs
38-
<!--- Provide a full docker log, output of "docker logs ldap-auth" -->

Jenkinsfile

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pipeline {
5757
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
5858
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
5959
env.PULL_REQUEST = env.CHANGE_ID
60-
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml'
60+
env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger.yml ./.github/workflows/external_trigger_scheduler.yml'
6161
}
6262
script{
6363
env.LS_RELEASE_NUMBER = sh(
@@ -136,6 +136,7 @@ pipeline {
136136
} else {
137137
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
138138
}
139+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
139140
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
140141
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
141142
}
@@ -157,6 +158,7 @@ pipeline {
157158
} else {
158159
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
159160
}
161+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
160162
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
161163
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
162164
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
@@ -178,6 +180,7 @@ pipeline {
178180
} else {
179181
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
180182
}
183+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
181184
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
182185
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
183186
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
@@ -239,9 +242,12 @@ pipeline {
239242
git checkout -f master
240243
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
241244
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
242-
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/
245+
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
246+
rm -f ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE.md
247+
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
243248
cd ${TEMPDIR}/repo/${LS_REPO}/
244249
git add ${TEMPLATED_FILES}
250+
git rm .github/ISSUE_TEMPLATE.md || :
245251
git commit -m 'Bot Updating Templated Files'
246252
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
247253
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
@@ -311,8 +317,9 @@ pipeline {
311317
environment name: 'EXIT_STATUS', value: ''
312318
}
313319
steps {
320+
echo "Running on node: ${NODE_NAME}"
314321
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
315-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
322+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
316323
}
317324
}
318325
// Build MultiArch Docker containers for push to LS Repo
@@ -324,21 +331,23 @@ pipeline {
324331
parallel {
325332
stage('Build X86') {
326333
steps {
334+
echo "Running on node: ${NODE_NAME}"
327335
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
328-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
336+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
329337
}
330338
}
331339
stage('Build ARMHF') {
332340
agent {
333341
label 'ARMHF'
334342
}
335343
steps {
344+
echo "Running on node: ${NODE_NAME}"
336345
echo 'Logging into Github'
337346
sh '''#! /bin/bash
338347
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
339348
'''
340349
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
341-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
350+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
342351
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
343352
retry(5) {
344353
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -353,12 +362,13 @@ pipeline {
353362
label 'ARM64'
354363
}
355364
steps {
365+
echo "Running on node: ${NODE_NAME}"
356366
echo 'Logging into Github'
357367
sh '''#! /bin/bash
358368
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
359369
'''
360370
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
361-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
371+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
362372
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
363373
retry(5) {
364374
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -431,6 +441,13 @@ pipeline {
431441
environment name: 'EXIT_STATUS', value: ''
432442
}
433443
steps {
444+
sh '''#! /bin/bash
445+
echo "Packages were updated. Cleaning up the image and exiting."
446+
if [ "${MULTIARCH}" == "true" ]; then
447+
docker rmi ${IMAGE}:amd64-${META_TAG}
448+
else
449+
docker rmi ${IMAGE}:${META_TAG}
450+
fi'''
434451
script{
435452
env.EXIT_STATUS = 'ABORTED'
436453
}
@@ -448,6 +465,13 @@ pipeline {
448465
}
449466
}
450467
steps {
468+
sh '''#! /bin/bash
469+
echo "There are no package updates. Cleaning up the image and exiting."
470+
if [ "${MULTIARCH}" == "true" ]; then
471+
docker rmi ${IMAGE}:amd64-${META_TAG}
472+
else
473+
docker rmi ${IMAGE}:${META_TAG}
474+
fi'''
451475
script{
452476
env.EXIT_STATUS = 'ABORTED'
453477
}
@@ -537,7 +561,7 @@ pipeline {
537561
'''
538562
}
539563
sh '''#! /bin/bash
540-
for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
564+
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
541565
docker rmi \
542566
${DELETEIMAGE}:${META_TAG} \
543567
${DELETEIMAGE}:${EXT_RELEASE_TAG} \
@@ -601,6 +625,7 @@ pipeline {
601625
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
602626
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
603627
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
628+
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || :
604629
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
605630
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
606631
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
@@ -615,10 +640,13 @@ pipeline {
615640
docker rmi \
616641
${DELETEIMAGE}:amd64-${META_TAG} \
617642
${DELETEIMAGE}:amd64-latest \
643+
${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \
618644
${DELETEIMAGE}:arm32v7-${META_TAG} \
619645
${DELETEIMAGE}:arm32v7-latest \
646+
${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \
620647
${DELETEIMAGE}:arm64v8-${META_TAG} \
621-
${DELETEIMAGE}:arm64v8-latest || :
648+
${DELETEIMAGE}:arm64v8-latest \
649+
${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || :
622650
done
623651
docker rmi \
624652
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
@@ -685,7 +713,7 @@ pipeline {
685713
-e DOCKER_REPOSITORY=${IMAGE} \
686714
-e GIT_BRANCH=master \
687715
-v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \
688-
ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
716+
ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
689717
rm -Rf ${TEMPDIR} '''
690718
}
691719
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Find us at:
3131
[![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-ldap-auth.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-ldap-auth)
3232
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-ldap-auth.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-ldap-auth/releases)
3333
[![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-ldap-auth/packages)
34-
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-ldap-auth/container_registry)
34+
[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-ldap-auth/container_registry)
3535
[![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/ldap-auth.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/ldap-auth "Get your own version badge on microbadger.com")
3636
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/ldap-auth.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/ldap-auth)
3737
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/ldap-auth.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/ldap-auth)

0 commit comments

Comments
 (0)