Skip to content

Commit 4864ce1

Browse files
Bot Updating Templated Files
1 parent 93878ef commit 4864ce1

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Jenkinsfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ pipeline {
285285
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
286286
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
287287
git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
288-
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true ghcr.io/linuxserver/jenkins-builder:latest
288+
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true -e PUID=$(id -u) -e PGID=$(id -g) ghcr.io/linuxserver/jenkins-builder:latest
289289
echo "Starting Stage 1 - Jenkinsfile update"
290290
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
291291
mkdir -p ${TEMPDIR}/repo
@@ -392,11 +392,15 @@ pipeline {
392392
cd ${TEMPDIR}/unraid/templates/
393393
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
394394
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
395-
echo "Image is on the ignore list, marking Unraid template as deprecated"
396-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
397-
git add -u unraid/${CONTAINER_NAME}.xml
398-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
399-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
395+
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
396+
echo "Image is on the ignore list, marking Unraid template as deprecated"
397+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
398+
git add -u unraid/${CONTAINER_NAME}.xml
399+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
400+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
401+
else
402+
echo "Image is on the ignore list, but no template exist, skipping deprecation"
403+
fi
400404
else
401405
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
402406
git add unraid/${CONTAINER_NAME}.xml
@@ -618,7 +622,7 @@ pipeline {
618622
sh '''#! /bin/bash
619623
set -e
620624
TEMPDIR=$(mktemp -d)
621-
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
625+
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" != "true" ]; then
622626
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
623627
else
624628
LOCAL_CONTAINER=${IMAGE}:${META_TAG}

0 commit comments

Comments
 (0)