Skip to content

Commit

Permalink
Remove "CREATE_ARCHIVE"; archive .deb/.rpm's artifacts directly
Browse files Browse the repository at this point in the history
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 <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 22, 2021
1 parent 6aede34 commit 3fcc219
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 16 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
archive/
artifacts/
build/
common/containerd.service
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
1 change: 0 additions & 1 deletion dockerfiles/deb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \
Expand Down
1 change: 0 additions & 1 deletion dockerfiles/rpm.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/ \
Expand Down
5 changes: 0 additions & 5 deletions scripts/build-deb
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 0 additions & 5 deletions scripts/build-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3fcc219

Please sign in to comment.