Skip to content
This repository was archived by the owner on Jan 7, 2024. It is now read-only.

Commit afacd17

Browse files
Bot Updating Templated Files
1 parent 6aed053 commit afacd17

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

Jenkinsfile

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,8 @@ pipeline {
442442
}
443443
steps {
444444
echo "Running on node: ${NODE_NAME}"
445-
sh "docker build \
445+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
446+
sh "docker buildx build \
446447
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
447448
--label \"org.opencontainers.image.authors=linuxserver.io\" \
448449
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-unifi-controller/packages\" \
@@ -455,7 +456,7 @@ pipeline {
455456
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
456457
--label \"org.opencontainers.image.title=Unifi-controller\" \
457458
--label \"org.opencontainers.image.description=The [Unifi-controller](https://www.ubnt.com/enterprise/#unifi) software is a powerful, enterprise wireless software engine ideal for high-density client deployments requiring low latency and high uptime performance.\" \
458-
--no-cache --pull -t ${IMAGE}:${META_TAG} \
459+
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
459460
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
460461
}
461462
}
@@ -472,7 +473,8 @@ pipeline {
472473
stage('Build X86') {
473474
steps {
474475
echo "Running on node: ${NODE_NAME}"
475-
sh "docker build \
476+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile"
477+
sh "docker buildx build \
476478
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
477479
--label \"org.opencontainers.image.authors=linuxserver.io\" \
478480
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-unifi-controller/packages\" \
@@ -485,7 +487,7 @@ pipeline {
485487
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
486488
--label \"org.opencontainers.image.title=Unifi-controller\" \
487489
--label \"org.opencontainers.image.description=The [Unifi-controller](https://www.ubnt.com/enterprise/#unifi) software is a powerful, enterprise wireless software engine ideal for high-density client deployments requiring low latency and high uptime performance.\" \
488-
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \
490+
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
489491
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
490492
}
491493
}
@@ -499,7 +501,8 @@ pipeline {
499501
sh '''#! /bin/bash
500502
echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin
501503
'''
502-
sh "docker build \
504+
sh "sed -r -i 's|(^FROM .*)|\\1\\n\\nENV LSIO_FIRST_PARTY=true|g' Dockerfile.aarch64"
505+
sh "docker buildx build \
503506
--label \"org.opencontainers.image.created=${GITHUB_DATE}\" \
504507
--label \"org.opencontainers.image.authors=linuxserver.io\" \
505508
--label \"org.opencontainers.image.url=https://github.com/linuxserver/docker-unifi-controller/packages\" \
@@ -512,7 +515,7 @@ pipeline {
512515
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
513516
--label \"org.opencontainers.image.title=Unifi-controller\" \
514517
--label \"org.opencontainers.image.description=The [Unifi-controller](https://www.ubnt.com/enterprise/#unifi) software is a powerful, enterprise wireless software engine ideal for high-density client deployments requiring low latency and high uptime performance.\" \
515-
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \
518+
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
516519
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
517520
sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}"
518521
retry(5) {
@@ -541,26 +544,12 @@ pipeline {
541544
else
542545
LOCAL_CONTAINER=${IMAGE}:${META_TAG}
543546
fi
544-
if [ "${DIST_IMAGE}" == "alpine" ]; then
545-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
546-
apk info -v > /tmp/package_versions.txt && \
547-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
548-
chmod 777 /tmp/package_versions.txt'
549-
elif [ "${DIST_IMAGE}" == "ubuntu" ]; then
550-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
551-
apt list -qq --installed | sed "s#/.*now ##g" | cut -d" " -f1 > /tmp/package_versions.txt && \
552-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
553-
chmod 777 /tmp/package_versions.txt'
554-
elif [ "${DIST_IMAGE}" == "fedora" ]; then
555-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
556-
rpm -qa > /tmp/package_versions.txt && \
557-
sort -o /tmp/package_versions.txt /tmp/package_versions.txt && \
558-
chmod 777 /tmp/package_versions.txt'
559-
elif [ "${DIST_IMAGE}" == "arch" ]; then
560-
docker run --rm --entrypoint '/bin/sh' -v ${TEMPDIR}:/tmp ${LOCAL_CONTAINER} -c '\
561-
pacman -Q > /tmp/package_versions.txt && \
562-
chmod 777 /tmp/package_versions.txt'
563-
fi
547+
touch ${TEMPDIR}/package_versions.txt
548+
docker run --rm \
549+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
550+
-v ${TEMPDIR}:/tmp \
551+
ghcr.io/anchore/syft:latest \
552+
${LOCAL_CONTAINER} -o table=/tmp/package_versions.txt
564553
NEW_PACKAGE_TAG=$(md5sum ${TEMPDIR}/package_versions.txt | cut -c1-8 )
565554
echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github"
566555
if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then

0 commit comments

Comments
 (0)