Skip to content

Commit 04718bb

Browse files
Bot Updating Templated Files
1 parent 29c2b2b commit 04718bb

File tree

1 file changed

+18
-28
lines changed

1 file changed

+18
-28
lines changed

Jenkinsfile

+18-28
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,8 @@ pipeline {
446446
}
447447
steps {
448448
echo "Running on node: ${NODE_NAME}"
449-
sh "docker build \
449+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
450+
sh "docker buildx build \
450451
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
451452
--label \"org.opencontainers.image.authors=linuxserver.io\" \
452453
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-mariadb/packages\" \
@@ -459,7 +460,7 @@ pipeline {
459460
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
460461
--label \"org.opencontainers.image.title=Mariadb\" \
461462
--label \"org.opencontainers.image.description=[Mariadb](https://mariadb.org/) is one of the most popular database servers. Made by the original developers of MySQL.\" \
462-
--no-cache --pull -t ${IMAGE}:${META_TAG} \
463+
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
463464
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
464465
}
465466
}
@@ -476,7 +477,8 @@ pipeline {
476477
stage('Build X86') {
477478
steps {
478479
echo "Running on node: ${NODE_NAME}"
479-
sh "docker build \
480+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
481+
sh "docker buildx build \
480482
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
481483
--label \"org.opencontainers.image.authors=linuxserver.io\" \
482484
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-mariadb/packages\" \
@@ -489,7 +491,7 @@ pipeline {
489491
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
490492
--label \"org.opencontainers.image.title=Mariadb\" \
491493
--label \"org.opencontainers.image.description=[Mariadb](https://mariadb.org/) is one of the most popular database servers. Made by the original developers of MySQL.\" \
492-
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
494+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
493495
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
494496
}
495497
}
@@ -503,7 +505,8 @@ pipeline {
503505
sh '''#! /bin/bash
504506
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
505507
'''
506-
sh "docker build \
508+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.armhf"
509+
sh "docker buildx build \
507510
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
508511
--label \"org.opencontainers.image.authors=linuxserver.io\" \
509512
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-mariadb/packages\" \
@@ -516,7 +519,7 @@ pipeline {
516519
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
517520
--label \"org.opencontainers.image.title=Mariadb\" \
518521
--label \"org.opencontainers.image.description=[Mariadb](https://mariadb.org/) is one of the most popular database servers. Made by the original developers of MySQL.\" \
519-
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
522+
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} --platform=linux/arm/v7 \
520523
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
521524
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
522525
retry(5) {
@@ -537,7 +540,8 @@ pipeline {
537540
sh '''#! /bin/bash
538541
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
539542
'''
540-
sh "docker build \
543+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64"
544+
sh "docker buildx build \
541545
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
542546
--label \"org.opencontainers.image.authors=linuxserver.io\" \
543547
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-mariadb/packages\" \
@@ -550,7 +554,7 @@ pipeline {
550554
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
551555
--label \"org.opencontainers.image.title=Mariadb\" \
552556
--label \"org.opencontainers.image.description=[Mariadb](https://mariadb.org/) is one of the most popular database servers. Made by the original developers of MySQL.\" \
553-
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
557+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
554558
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
555559
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
556560
retry(5) {
@@ -579,26 +583,12 @@ pipeline {
579583
else
580584
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
581585
fi
582-
if [ "${DIST_IMAGE}" == "alpine" ]; then
583-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
584-
apk info -v > /tmp/package_versions.txt && \
585-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
586-
chmod 777 /tmp/package_versions.txt'
587-
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
588-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
589-
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
590-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
591-
chmod 777 /tmp/package_versions.txt'
592-
elif [ "${DIST_IMAGE}" == "fedora" ]; then
593-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
594-
rpm -qa > /tmp/package_versions.txt && \
595-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
596-
chmod 777 /tmp/package_versions.txt'
597-
elif [ "${DIST_IMAGE}" == "arch" ]; then
598-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
599-
pacman -Q > /tmp/package_versions.txt && \
600-
chmod 777 /tmp/package_versions.txt'
601-
fi
586+
touch ${TEMPDIR}/package_versions.txt
587+
docker run --rm \
588+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
589+
-v ${TEMPDIR}:/tmp \
590+
ghcr.io/anchore/syft:latest \
591+
${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
602592
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
603593
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
604594
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then

0 commit comments

Comments
 (0)