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

Commit f330493

Browse files
Bot Updating Templated Files
1 parent a1f07bf commit f330493

File tree

4 files changed

+57
-49
lines changed

4 files changed

+57
-49
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 booksonic-air" -->

.github/workflows/greetings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ jobs:
88
steps:
99
- uses: actions/first-interaction@v1
1010
with:
11-
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [issue template](https://github.com/linuxserver/docker-booksonic-air/blob/master/.github/ISSUE_TEMPLATE.md)!'
11+
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-booksonic-air/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-booksonic-air/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
1212
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-booksonic-air/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
1313
repo-token: ${{ secrets.GITHUB_TOKEN }}

Jenkinsfile

Lines changed: 55 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pipeline {
5858
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT
5959
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/'
6060
env.PULL_REQUEST = env.CHANGE_ID
61-
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'
61+
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'
6262
}
6363
script{
6464
env.LS_RELEASE_NUMBER = sh(
@@ -145,6 +145,7 @@ pipeline {
145145
} else {
146146
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
147147
}
148+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
148149
env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER
149150
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
150151
}
@@ -166,6 +167,7 @@ pipeline {
166167
} else {
167168
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
168169
}
170+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
169171
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA
170172
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
171173
env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/'
@@ -187,6 +189,7 @@ pipeline {
187189
} else {
188190
env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
189191
}
192+
env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
190193
env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST
191194
env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN
192195
env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST
@@ -248,9 +251,12 @@ pipeline {
248251
git checkout -f master
249252
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
250253
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
251-
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/
254+
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
255+
rm -f ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE.md
256+
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
252257
cd ${TEMPDIR}/repo/${LS_REPO}/
253258
git add ${TEMPLATED_FILES}
259+
git rm .github/ISSUE_TEMPLATE.md || :
254260
git commit -m 'Bot Updating Templated Files'
255261
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
256262
echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER}
@@ -259,13 +265,30 @@ pipeline {
259265
fi
260266
mkdir -p ${TEMPDIR}/gitbook
261267
git clone https://github.com/linuxserver/docker-documentation.git ${TEMPDIR}/gitbook/docker-documentation
262-
if [[ "${BRANCH_NAME}" == "master" ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
268+
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md) || ("$(md5sum ${TEMPDIR}/gitbook/docker-documentation/images/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md | awk '{ print $1 }')") ]]; then
263269
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/docker-${CONTAINER_NAME}.md ${TEMPDIR}/gitbook/docker-documentation/images/
264270
cd ${TEMPDIR}/gitbook/docker-documentation/
265271
git add images/docker-${CONTAINER_NAME}.md
266272
git commit -m 'Bot Updating Documentation'
267273
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git --all
268274
fi
275+
mkdir -p ${TEMPDIR}/unraid
276+
git clone https://github.com/linuxserver/docker-templates.git ${TEMPDIR}/unraid/docker-templates
277+
git clone https://github.com/linuxserver/templates.git ${TEMPDIR}/unraid/templates
278+
if [[ -f ${TEMPDIR}/unraid/docker-templates/linuxserver.io/img/${CONTAINER_NAME}-icon.png ]]; then
279+
sed -i "s|master/linuxserver.io/img/linuxserver-ls-logo.png|master/linuxserver.io/img/${CONTAINER_NAME}-icon.png|" ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml
280+
fi
281+
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
282+
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
283+
echo "Image is on the ignore list, skipping Unraid template upload"
284+
else
285+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
286+
cd ${TEMPDIR}/unraid/templates/
287+
git add unraid/${CONTAINER_NAME}.xml
288+
git commit -m 'Bot Updating Unraid Template'
289+
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/templates.git --all
290+
fi
291+
fi
269292
rm -Rf ${TEMPDIR}'''
270293
script{
271294
env.FILES_UPDATED = sh(
@@ -320,8 +343,9 @@ pipeline {
320343
environment name: 'EXIT_STATUS', value: ''
321344
}
322345
steps {
346+
echo "Running on node: ${NODE_NAME}"
323347
sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \
324-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
348+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
325349
}
326350
}
327351
// Build MultiArch Docker containers for push to LS Repo
@@ -333,21 +357,23 @@ pipeline {
333357
parallel {
334358
stage('Build X86') {
335359
steps {
360+
echo "Running on node: ${NODE_NAME}"
336361
sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
337-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
362+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
338363
}
339364
}
340365
stage('Build ARMHF') {
341366
agent {
342367
label 'ARMHF'
343368
}
344369
steps {
370+
echo "Running on node: ${NODE_NAME}"
345371
echo 'Logging into Github'
346372
sh '''#! /bin/bash
347373
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
348374
'''
349375
sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
350-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
376+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
351377
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
352378
retry(5) {
353379
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -362,12 +388,13 @@ pipeline {
362388
label 'ARM64'
363389
}
364390
steps {
391+
echo "Running on node: ${NODE_NAME}"
365392
echo 'Logging into Github'
366393
sh '''#! /bin/bash
367394
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
368395
'''
369396
sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
370-
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
397+
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
371398
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
372399
retry(5) {
373400
sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
@@ -440,6 +467,13 @@ pipeline {
440467
environment name: 'EXIT_STATUS', value: ''
441468
}
442469
steps {
470+
sh '''#! /bin/bash
471+
echo "Packages were updated. Cleaning up the image and exiting."
472+
if [ "${MULTIARCH}" == "true" ]; then
473+
docker rmi ${IMAGE}:amd64-${META_TAG}
474+
else
475+
docker rmi ${IMAGE}:${META_TAG}
476+
fi'''
443477
script{
444478
env.EXIT_STATUS = 'ABORTED'
445479
}
@@ -457,6 +491,13 @@ pipeline {
457491
}
458492
}
459493
steps {
494+
sh '''#! /bin/bash
495+
echo "There are no package updates. Cleaning up the image and exiting."
496+
if [ "${MULTIARCH}" == "true" ]; then
497+
docker rmi ${IMAGE}:amd64-${META_TAG}
498+
else
499+
docker rmi ${IMAGE}:${META_TAG}
500+
fi'''
460501
script{
461502
env.EXIT_STATUS = 'ABORTED'
462503
}
@@ -546,7 +587,7 @@ pipeline {
546587
'''
547588
}
548589
sh '''#! /bin/bash
549-
for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do
590+
for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do
550591
docker rmi \
551592
${DELETEIMAGE}:${META_TAG} \
552593
${DELETEIMAGE}:${EXT_RELEASE_TAG} \
@@ -610,6 +651,7 @@ pipeline {
610651
docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
611652
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm
612653
docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8
654+
docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || :
613655
docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
614656
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm
615657
docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8
@@ -624,10 +666,13 @@ pipeline {
624666
docker rmi \
625667
${DELETEIMAGE}:amd64-${META_TAG} \
626668
${DELETEIMAGE}:amd64-latest \
669+
${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \
627670
${DELETEIMAGE}:arm32v7-${META_TAG} \
628671
${DELETEIMAGE}:arm32v7-latest \
672+
${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \
629673
${DELETEIMAGE}:arm64v8-${META_TAG} \
630-
${DELETEIMAGE}:arm64v8-latest || :
674+
${DELETEIMAGE}:arm64v8-latest \
675+
${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || :
631676
done
632677
docker rmi \
633678
ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \
@@ -694,7 +739,7 @@ pipeline {
694739
-e DOCKER_REPOSITORY=${IMAGE} \
695740
-e GIT_BRANCH=master \
696741
-v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \
697-
ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
742+
ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync'
698743
rm -Rf ${TEMPDIR} '''
699744
}
700745
}

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-booksonic-air.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-booksonic-air)
3232
[![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-booksonic-air.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-booksonic-air/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-booksonic-air/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-booksonic-air/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-booksonic-air/container_registry)
3535
[![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/booksonic-air.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/booksonic-air "Get your own version badge on microbadger.com")
3636
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/booksonic-air.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/booksonic-air)
3737
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/booksonic-air.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/booksonic-air)

0 commit comments

Comments
 (0)