Skip to content

Commit 180f6b9

Browse files
Bot Updating Templated Files
1 parent cab4a7e commit 180f6b9

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
@@ -279,7 +279,7 @@ pipeline {
279279
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
280280
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
281281
git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
282-
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true ghcr.io/linuxserver/jenkins-builder:latest
282+
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
283283
echo "Starting Stage 1 - Jenkinsfile update"
284284
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
285285
mkdir -p ${TEMPDIR}/repo
@@ -386,11 +386,15 @@ pipeline {
386386
cd ${TEMPDIR}/unraid/templates/
387387
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
388388
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
389-
echo "Image is on the ignore list, marking Unraid template as deprecated"
390-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
391-
git add -u unraid/${CONTAINER_NAME}.xml
392-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
393-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
389+
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
390+
echo "Image is on the ignore list, marking Unraid template as deprecated"
391+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
392+
git add -u unraid/${CONTAINER_NAME}.xml
393+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
394+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
395+
else
396+
echo "Image is on the ignore list, but no template exist, skipping deprecation"
397+
fi
394398
else
395399
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
396400
git add unraid/${CONTAINER_NAME}.xml
@@ -612,7 +616,7 @@ pipeline {
612616
sh '''#! /bin/bash
613617
set -e
614618
TEMPDIR=$(mktemp -d)
615-
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
619+
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" != "true" ]; then
616620
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
617621
else
618622
LOCAL_CONTAINER=${IMAGE}:${META_TAG}

0 commit comments

Comments
 (0)