Skip to content

Commit c0cc940

Browse files
Bot Updating Templated Files
1 parent 602677f commit c0cc940

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
@@ -452,7 +452,8 @@ pipeline {
452452
}
453453
steps {
454454
echo "Running on node: ${NODE_NAME}"
455-
sh "docker build \
455+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
456+
sh "docker buildx build \
456457
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
457458
--label \"org.opencontainers.image.authors=linuxserver.io\" \
458459
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-bookstack/packages\" \
@@ -465,7 +466,7 @@ pipeline {
465466
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
466467
--label \"org.opencontainers.image.title=Bookstack\" \
467468
--label \"org.opencontainers.image.description=[Bookstack](https://github.com/BookStackApp/BookStack) is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease. Powered by SQL and including a Markdown editor for those who prefer it, BookStack is geared towards making documentation more of a pleasure than a chore. For more information on BookStack visit their website and check it out: https://www.bookstackapp.com \" \
468-
--no-cache --pull -t ${IMAGE}:${META_TAG} \
469+
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
469470
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
470471
}
471472
}
@@ -482,7 +483,8 @@ pipeline {
482483
stage('Build X86') {
483484
steps {
484485
echo "Running on node: ${NODE_NAME}"
485-
sh "docker build \
486+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
487+
sh "docker buildx build \
486488
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
487489
--label \"org.opencontainers.image.authors=linuxserver.io\" \
488490
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-bookstack/packages\" \
@@ -495,7 +497,7 @@ pipeline {
495497
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
496498
--label \"org.opencontainers.image.title=Bookstack\" \
497499
--label \"org.opencontainers.image.description=[Bookstack](https://github.com/BookStackApp/BookStack) is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease. Powered by SQL and including a Markdown editor for those who prefer it, BookStack is geared towards making documentation more of a pleasure than a chore. For more information on BookStack visit their website and check it out: https://www.bookstackapp.com \" \
498-
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
500+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
499501
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
500502
}
501503
}
@@ -509,7 +511,8 @@ pipeline {
509511
sh '''#! /bin/bash
510512
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
511513
'''
512-
sh "docker build \
514+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.armhf"
515+
sh "docker buildx build \
513516
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
514517
--label \"org.opencontainers.image.authors=linuxserver.io\" \
515518
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-bookstack/packages\" \
@@ -522,7 +525,7 @@ pipeline {
522525
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
523526
--label \"org.opencontainers.image.title=Bookstack\" \
524527
--label \"org.opencontainers.image.description=[Bookstack](https://github.com/BookStackApp/BookStack) is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease. Powered by SQL and including a Markdown editor for those who prefer it, BookStack is geared towards making documentation more of a pleasure than a chore. For more information on BookStack visit their website and check it out: https://www.bookstackapp.com \" \
525-
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
528+
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} --platform=linux/arm/v7 \
526529
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
527530
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
528531
retry(5) {
@@ -543,7 +546,8 @@ pipeline {
543546
sh '''#! /bin/bash
544547
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
545548
'''
546-
sh "docker build \
549+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64"
550+
sh "docker buildx build \
547551
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
548552
--label \"org.opencontainers.image.authors=linuxserver.io\" \
549553
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-bookstack/packages\" \
@@ -556,7 +560,7 @@ pipeline {
556560
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
557561
--label \"org.opencontainers.image.title=Bookstack\" \
558562
--label \"org.opencontainers.image.description=[Bookstack](https://github.com/BookStackApp/BookStack) is a free and open source Wiki designed for creating beautiful documentation. Featuring a simple, but powerful WYSIWYG editor it allows for teams to create detailed and useful documentation with ease. Powered by SQL and including a Markdown editor for those who prefer it, BookStack is geared towards making documentation more of a pleasure than a chore. For more information on BookStack visit their website and check it out: https://www.bookstackapp.com \" \
559-
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
563+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
560564
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
561565
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
562566
retry(5) {
@@ -585,26 +589,12 @@ pipeline {
585589
else
586590
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
587591
fi
588-
if [ "${DIST_IMAGE}" == "alpine" ]; then
589-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
590-
apk info -v > /tmp/package_versions.txt && \
591-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
592-
chmod 777 /tmp/package_versions.txt'
593-
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
594-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
595-
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
596-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
597-
chmod 777 /tmp/package_versions.txt'
598-
elif [ "${DIST_IMAGE}" == "fedora" ]; then
599-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
600-
rpm -qa > /tmp/package_versions.txt && \
601-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
602-
chmod 777 /tmp/package_versions.txt'
603-
elif [ "${DIST_IMAGE}" == "arch" ]; then
604-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
605-
pacman -Q > /tmp/package_versions.txt && \
606-
chmod 777 /tmp/package_versions.txt'
607-
fi
592+
touch ${TEMPDIR}/package_versions.txt
593+
docker run --rm \
594+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
595+
-v ${TEMPDIR}:/tmp \
596+
ghcr.io/anchore/syft:latest \
597+
${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
608598
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
609599
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
610600
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then

0 commit comments

Comments
 (0)