Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Commit 4c14b96

Browse files
Bot Updating Templated Files
1 parent 8535f82 commit 4c14b96

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
@@ -444,7 +444,8 @@ pipeline {
444444
}
445445
steps {
446446
echo "Running on node: ${NODE_NAME}"
447-
sh "docker build \
447+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
448+
sh "docker buildx build \
448449
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
449450
--label \"org.opencontainers.image.authors=linuxserver.io\" \
450451
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-embystat/packages\" \
@@ -457,7 +458,7 @@ pipeline {
457458
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
458459
--label \"org.opencontainers.image.title=Embystat\" \
459460
--label \"org.opencontainers.image.description=[Embystat](https://github.com/mregni/EmbyStat) is a personal web server that can calculate all kinds of statistics from your (local) Emby server. Just install this on your server and let him calculate all kinds of fun stuff.\" \
460-
--no-cache --pull -t ${IMAGE}:${META_TAG} \
461+
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
461462
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
462463
}
463464
}
@@ -474,7 +475,8 @@ pipeline {
474475
stage('Build X86') {
475476
steps {
476477
echo "Running on node: ${NODE_NAME}"
477-
sh "docker build \
478+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
479+
sh "docker buildx build \
478480
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
479481
--label \"org.opencontainers.image.authors=linuxserver.io\" \
480482
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-embystat/packages\" \
@@ -487,7 +489,7 @@ pipeline {
487489
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
488490
--label \"org.opencontainers.image.title=Embystat\" \
489491
--label \"org.opencontainers.image.description=[Embystat](https://github.com/mregni/EmbyStat) is a personal web server that can calculate all kinds of statistics from your (local) Emby server. Just install this on your server and let him calculate all kinds of fun stuff.\" \
490-
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
492+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
491493
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
492494
}
493495
}
@@ -501,7 +503,8 @@ pipeline {
501503
sh '''#! /bin/bash
502504
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
503505
'''
504-
sh "docker build \
506+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.armhf"
507+
sh "docker buildx build \
505508
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
506509
--label \"org.opencontainers.image.authors=linuxserver.io\" \
507510
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-embystat/packages\" \
@@ -514,7 +517,7 @@ pipeline {
514517
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
515518
--label \"org.opencontainers.image.title=Embystat\" \
516519
--label \"org.opencontainers.image.description=[Embystat](https://github.com/mregni/EmbyStat) is a personal web server that can calculate all kinds of statistics from your (local) Emby server. Just install this on your server and let him calculate all kinds of fun stuff.\" \
517-
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \
520+
--no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} --platform=linux/arm/v7 \
518521
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
519522
sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}"
520523
retry(5) {
@@ -535,7 +538,8 @@ pipeline {
535538
sh '''#! /bin/bash
536539
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
537540
'''
538-
sh "docker build \
541+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64"
542+
sh "docker buildx build \
539543
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
540544
--label \"org.opencontainers.image.authors=linuxserver.io\" \
541545
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-embystat/packages\" \
@@ -548,7 +552,7 @@ pipeline {
548552
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
549553
--label \"org.opencontainers.image.title=Embystat\" \
550554
--label \"org.opencontainers.image.description=[Embystat](https://github.com/mregni/EmbyStat) is a personal web server that can calculate all kinds of statistics from your (local) Emby server. Just install this on your server and let him calculate all kinds of fun stuff.\" \
551-
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
555+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
552556
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
553557
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
554558
retry(5) {
@@ -577,26 +581,12 @@ pipeline {
577581
else
578582
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
579583
fi
580-
if [ "${DIST_IMAGE}" == "alpine" ]; then
581-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
582-
apk info -v > /tmp/package_versions.txt && \
583-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
584-
chmod 777 /tmp/package_versions.txt'
585-
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
586-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
587-
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
588-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
589-
chmod 777 /tmp/package_versions.txt'
590-
elif [ "${DIST_IMAGE}" == "fedora" ]; then
591-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
592-
rpm -qa > /tmp/package_versions.txt && \
593-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
594-
chmod 777 /tmp/package_versions.txt'
595-
elif [ "${DIST_IMAGE}" == "arch" ]; then
596-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
597-
pacman -Q > /tmp/package_versions.txt && \
598-
chmod 777 /tmp/package_versions.txt'
599-
fi
584+
touch ${TEMPDIR}/package_versions.txt
585+
docker run --rm \
586+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
587+
-v ${TEMPDIR}:/tmp \
588+
ghcr.io/anchore/syft:latest \
589+
${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
600590
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
601591
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
602592
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then

0 commit comments

Comments
 (0)