From d621bfc47fc504ef351e9e9b53fa9cdd3654ffb7 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 23 Apr 2020 19:05:18 +0200 Subject: [PATCH] Remove "CREATE_ARCHIVE"; archive .deb/.rpm's artifacts directly deb and rpm packages are already compressed, so compressing them again does not save any space. This patch removes the "CREATE_ARCHIVE" option, and instead just the deb/rpm's itself as artifacts Signed-off-by: Sebastiaan van Stijn --- .gitignore | 1 - Jenkinsfile | 4 ++-- Makefile | 1 - dockerfiles/deb.dockerfile | 1 - dockerfiles/rpm.dockerfile | 1 - scripts/build-deb | 5 ----- scripts/build-rpm | 5 ----- 7 files changed, 2 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 884b1353..a1a299c1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -archive/ artifacts/ build/ common/containerd.service diff --git a/Jenkinsfile b/Jenkinsfile index bbcca159..6a18f622 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,9 +37,9 @@ def generatePackageStep(opts, arch) { checkout scm sh 'make clean' withDockerRegistry([url: "", credentialsId: "dockerbuildbot-index.docker.io"]) { - sh "make CREATE_ARCHIVE=1 ${opts.image}" + sh "make ${opts.image}" } - archiveArtifacts(artifacts: 'archive/*.tar.gz', onlyIfSuccessful: true) + archiveArtifacts(artifacts: 'build/**/containerd.io*.*', onlyIfSuccessful: true) } finally { deleteDir() } diff --git a/Makefile b/Makefile index ac4277c1..b6a1d595 100644 --- a/Makefile +++ b/Makefile @@ -97,7 +97,6 @@ build: --build-arg GOLANG_IMAGE="$(GOLANG_IMAGE)" \ --build-arg BUILD_IMAGE="$(BUILD_IMAGE)" \ --build-arg BASE="$(BUILD_BASE)" \ - --build-arg CREATE_ARCHIVE="$(CREATE_ARCHIVE)" \ --build-arg UID="$(shell id -u)" \ --build-arg GID="$(shell id -g)" \ --file="dockerfiles/$(BUILD_TYPE).dockerfile" \ diff --git a/dockerfiles/deb.dockerfile b/dockerfiles/deb.dockerfile index 9fcd7dbc..c68a49ae 100644 --- a/dockerfiles/deb.dockerfile +++ b/dockerfiles/deb.dockerfile @@ -98,7 +98,6 @@ ENV PACKAGE=${PACKAGE:-containerd.io} FROM build-env AS build-packages RUN mkdir -p /archive /build COPY common/containerd.service common/containerd.toml /root/common/ -ARG CREATE_ARCHIVE # NOTE: not using a cache-mount for /root/.cache/go-build, to prevent issues # with CGO when building multiple distros on the same machine / build-cache RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/ \ diff --git a/dockerfiles/rpm.dockerfile b/dockerfiles/rpm.dockerfile index 9999a60d..0964d674 100644 --- a/dockerfiles/rpm.dockerfile +++ b/dockerfiles/rpm.dockerfile @@ -81,7 +81,6 @@ ENV PACKAGE=${PACKAGE:-containerd.io} FROM build-env AS build-packages RUN mkdir -p /archive /build COPY common/containerd.service common/containerd.toml SOURCES/ -ARG CREATE_ARCHIVE # NOTE: not using a cache-mount for /root/.cache/go-build, to prevent issues # with CGO when building multiple distros on the same machine / build-cache RUN --mount=type=bind,from=golang,source=/usr/local/go/,target=/usr/local/go/ \ diff --git a/scripts/build-deb b/scripts/build-deb index 1cb3cc11..7d36d797 100755 --- a/scripts/build-deb +++ b/scripts/build-deb @@ -62,8 +62,3 @@ if [ "${DIST_VERSION}" = 'n/a' ]; then echo "Failed to get release codename" exit 1 fi - -# Only create an archive if env variable is specified -if [ -n "${CREATE_ARCHIVE}" ]; then - tar -C /build -cvzf "/archive/${DIST_ID}-${DIST_VERSION}-${ARCH}.tar.gz" "${DIST_ID}/${DIST_VERSION}/${ARCH}" -fi diff --git a/scripts/build-rpm b/scripts/build-rpm index e2899ffa..a9375df5 100755 --- a/scripts/build-rpm +++ b/scripts/build-rpm @@ -74,8 +74,3 @@ DEST_DIR="/build/${DIST_ID}/${DIST_VERSION}/${ARCH}/" mv -v RPMS/*/*.rpm "${DEST_DIR}" mv -v SRPMS/*.rpm "${DEST_DIR}" ) - -# Only create an archive if env variable is specified -if [ -n "${CREATE_ARCHIVE}" ]; then - tar -C /build -cvzf "/archive/${DIST_ID}-${DIST_VERSION}-${ARCH}.tar.gz" "${DIST_ID}/${DIST_VERSION}/${ARCH}" -fi