Skip to content

Commit da430e5

Browse files
Bot Updating Templated Files
1 parent 427ed7a commit da430e5

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

Jenkinsfile

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ pipeline {
443443
}
444444
steps {
445445
echo "Running on node: ${NODE_NAME}"
446-
sh "docker build \
446+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
447+
sh "docker buildx build \
447448
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
448449
--label \"org.opencontainers.image.authors=linuxserver.io\" \
449450
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-ldap-auth/packages\" \
@@ -456,7 +457,7 @@ pipeline {
456457
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
457458
--label \"org.opencontainers.image.title=Ldap-auth\" \
458459
--label \"org.opencontainers.image.description=[Ldap-auth](https://github.com/nginxinc/nginx-ldap-auth) software is for authenticating users who request protected resources from servers proxied by nginx. It includes a daemon (ldap-auth) that communicates with an authentication server, and a webserver daemon that generates an authentication cookie based on the user’s credentials. The daemons are written in Python for use with a Lightweight Directory Access Protocol (LDAP) authentication server (OpenLDAP or Microsoft Windows Active Directory 2003 and 2012).\" \
459-
--no-cache --pull -t ${IMAGE}:${META_TAG} \
460+
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
460461
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
461462
}
462463
}
@@ -473,7 +474,8 @@ pipeline {
473474
stage('Build X86') {
474475
steps {
475476
echo "Running on node: ${NODE_NAME}"
476-
sh "docker build \
477+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
478+
sh "docker buildx build \
477479
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
478480
--label \"org.opencontainers.image.authors=linuxserver.io\" \
479481
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-ldap-auth/packages\" \
@@ -486,7 +488,7 @@ pipeline {
486488
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
487489
--label \"org.opencontainers.image.title=Ldap-auth\" \
488490
--label \"org.opencontainers.image.description=[Ldap-auth](https://github.com/nginxinc/nginx-ldap-auth) software is for authenticating users who request protected resources from servers proxied by nginx. It includes a daemon (ldap-auth) that communicates with an authentication server, and a webserver daemon that generates an authentication cookie based on the user’s credentials. The daemons are written in Python for use with a Lightweight Directory Access Protocol (LDAP) authentication server (OpenLDAP or Microsoft Windows Active Directory 2003 and 2012).\" \
489-
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
491+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
490492
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
491493
}
492494
}
@@ -500,7 +502,8 @@ pipeline {
500502
sh '''#! /bin/bash
501503
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
502504
'''
503-
sh "docker build \
505+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.armhf"
506+
sh "docker buildx build \
504507
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
505508
--label \"org.opencontainers.image.authors=linuxserver.io\" \
506509
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-ldap-auth/packages\" \
@@ -513,7 +516,7 @@ pipeline {
513516
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
514517
--label \"org.opencontainers.image.title=Ldap-auth\" \
515518
--label \"org.opencontainers.image.description=[Ldap-auth](https://github.com/nginxinc/nginx-ldap-auth) software is for authenticating users who request protected resources from servers proxied by nginx. It includes a daemon (ldap-auth) that communicates with an authentication server, and a webserver daemon that generates an authentication cookie based on the user’s credentials. The daemons are written in Python for use with a Lightweight Directory Access Protocol (LDAP) authentication server (OpenLDAP or Microsoft Windows Active Directory 2003 and 2012).\" \
516-
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
519+
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} --platform=linux/arm/v7 \
517520
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
518521
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
519522
retry(5) {
@@ -534,7 +537,8 @@ pipeline {
534537
sh '''#! /bin/bash
535538
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
536539
'''
537-
sh "docker build \
540+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64"
541+
sh "docker buildx build \
538542
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
539543
--label \"org.opencontainers.image.authors=linuxserver.io\" \
540544
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-ldap-auth/packages\" \
@@ -547,7 +551,7 @@ pipeline {
547551
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
548552
--label \"org.opencontainers.image.title=Ldap-auth\" \
549553
--label \"org.opencontainers.image.description=[Ldap-auth](https://github.com/nginxinc/nginx-ldap-auth) software is for authenticating users who request protected resources from servers proxied by nginx. It includes a daemon (ldap-auth) that communicates with an authentication server, and a webserver daemon that generates an authentication cookie based on the user’s credentials. The daemons are written in Python for use with a Lightweight Directory Access Protocol (LDAP) authentication server (OpenLDAP or Microsoft Windows Active Directory 2003 and 2012).\" \
550-
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
554+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
551555
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
552556
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
553557
retry(5) {
@@ -576,26 +580,12 @@ pipeline {
576580
else
577581
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
578582
fi
579-
if [ "${DIST_IMAGE}" == "alpine" ]; then
580-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
581-
apk info -v > /tmp/package_versions.txt && \
582-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
583-
chmod 777 /tmp/package_versions.txt'
584-
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
585-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
586-
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
587-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
588-
chmod 777 /tmp/package_versions.txt'
589-
elif [ "${DIST_IMAGE}" == "fedora" ]; then
590-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
591-
rpm -qa > /tmp/package_versions.txt && \
592-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
593-
chmod 777 /tmp/package_versions.txt'
594-
elif [ "${DIST_IMAGE}" == "arch" ]; then
595-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
596-
pacman -Q > /tmp/package_versions.txt && \
597-
chmod 777 /tmp/package_versions.txt'
598-
fi
583+
touch ${TEMPDIR}/package_versions.txt
584+
docker run --rm \
585+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
586+
-v ${TEMPDIR}:/tmp \
587+
ghcr.io/anchore/syft:latest \
588+
${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
599589
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
600590
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
601591
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then

0 commit comments

Comments
 (0)