Skip to content

Commit 6a7d64e

Browse files
Bot Updating Templated Files
1 parent 234d099 commit 6a7d64e

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Jenkinsfile

+11-7
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pipeline {
273273
# ${TEMPDIR}/unraid/docker-templates: Cloned docker-templates repo to check for logos
274274
# ${TEMPDIR}/unraid/templates: Cloned templates repo for commiting unraid template changes and pushing back to Github
275275
git clone --branch master --depth 1 https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/docker-${CONTAINER_NAME}
276-
docker run --rm -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/tmp -e LOCAL=true ghcr.io/linuxserver/jenkins-builder:latest
276+
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
277277
echo "Starting Stage 1 - Jenkinsfile update"
278278
if [[ "$(md5sum Jenkinsfile | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/Jenkinsfile | awk '{ print $1 }')" ]]; then
279279
mkdir -p ${TEMPDIR}/repo
@@ -380,11 +380,15 @@ pipeline {
380380
cd ${TEMPDIR}/unraid/templates/
381381
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
382382
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
383-
echo "Image is on the ignore list, marking Unraid template as deprecated"
384-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
385-
git add -u unraid/${CONTAINER_NAME}.xml
386-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
387-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
383+
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
384+
echo "Image is on the ignore list, marking Unraid template as deprecated"
385+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
386+
git add -u unraid/${CONTAINER_NAME}.xml
387+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
388+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
389+
else
390+
echo "Image is on the ignore list, but no template exist, skipping deprecation"
391+
fi
388392
else
389393
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
390394
git add unraid/${CONTAINER_NAME}.xml
@@ -606,7 +610,7 @@ pipeline {
606610
sh '''#! /bin/bash
607611
set -e
608612
TEMPDIR=$(mktemp -d)
609-
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" == "false" ]; then
613+
if [ "${MULTIARCH}" == "true" ] && [ "${PACKAGE_CHECK}" != "true" ]; then
610614
LOCAL_CONTAINER=${IMAGE}:amd64-${META_TAG}
611615
else
612616
LOCAL_CONTAINER=${IMAGE}:${META_TAG}

0 commit comments

Comments
 (0)