Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "CREATE_ARCHIVE"; archive .deb/.rpm's artifacts directly #175

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -67 to -69
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self; instead of tarring here, perhaps we can use docker build --output type=tar... (although that doesn't support compressing, but I guess all artefacts are already compressed, so from that perspective, it should be fine)

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