Skip to content

Commit 9de9d10

Browse files
Bot Updating Templated Files
1 parent d7ca9de commit 9de9d10

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

Jenkinsfile

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,21 @@ pipeline {
5858
steps{
5959
echo "Running on node: ${NODE_NAME}"
6060
sh '''#! /bin/bash
61-
containers=$(docker ps -aq)
61+
echo "Pruning builder"
62+
docker builder prune -f --builder container || :
63+
containers=$(docker ps -q)
6264
if [[ -n "${containers}" ]]; then
63-
docker stop ${containers}
65+
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
66+
for container in ${containers}; do
67+
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
68+
echo "skipping buildx container in docker stop"
69+
else
70+
echo "Stopping container ${container}"
71+
docker stop ${container}
72+
fi
73+
done
6474
fi
65-
docker system prune -af --volumes || : '''
75+
docker system prune -f --volumes || : '''
6676
script{
6777
env.EXIT_STATUS = ''
6878
env.LS_RELEASE = sh(
@@ -582,7 +592,7 @@ pipeline {
582592
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
583593
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
584594
--label \"org.opencontainers.image.title=Bambustudio\" \
585-
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) Bambu Studio is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
595+
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
586596
--no-cache --pull -t ${IMAGE}:${META_TAG} --platform=linux/amd64 \
587597
--provenance=true --sbom=true --builder=container --load \
588598
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
@@ -648,7 +658,7 @@ pipeline {
648658
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
649659
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
650660
--label \"org.opencontainers.image.title=Bambustudio\" \
651-
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) Bambu Studio is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
661+
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
652662
--no-cache --pull -t ${IMAGE}:amd64-${META_TAG} --platform=linux/amd64 \
653663
--provenance=true --sbom=true --builder=container --load \
654664
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
@@ -707,7 +717,7 @@ pipeline {
707717
--label \"org.opencontainers.image.licenses=GPL-3.0-only\" \
708718
--label \"org.opencontainers.image.ref.name=${COMMIT_SHA}\" \
709719
--label \"org.opencontainers.image.title=Bambustudio\" \
710-
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) Bambu Studio is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
720+
--label \"org.opencontainers.image.description=[Bambu Studio](https://bambulab.com/en/download/studio) is an open-source, cutting-edge, feature-rich slicing software. It contains project-based workflows, systematically optimized slicing algorithms, and an easy-to-use graphical interface, bringing users an incredibly smooth printing experience.\" \
711721
--no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} --platform=linux/arm64 \
712722
--provenance=true --sbom=true --builder=container --load \
713723
--build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ."
@@ -1161,12 +1171,21 @@ EOF
11611171
}
11621172
cleanup {
11631173
sh '''#! /bin/bash
1164-
echo "Performing docker system prune!!"
1165-
containers=$(docker ps -aq)
1174+
echo "Pruning builder!!"
1175+
docker builder prune -f --builder container || :
1176+
containers=$(docker ps -q)
11661177
if [[ -n "${containers}" ]]; then
1167-
docker stop ${containers}
1178+
BUILDX_CONTAINER_ID=$(docker ps -qf 'name=buildx_buildkit')
1179+
for container in ${containers}; do
1180+
if [[ "${container}" == "${BUILDX_CONTAINER_ID}" ]]; then
1181+
echo "skipping buildx container in docker stop"
1182+
else
1183+
echo "Stopping container ${container}"
1184+
docker stop ${container}
1185+
fi
1186+
done
11681187
fi
1169-
docker system prune -af --volumes || :
1188+
docker system prune -f --volumes || :
11701189
'''
11711190
cleanWs()
11721191
}

0 commit comments

Comments
 (0)