Standardize image artifact name

Standardize the arch in image artifact name to amd64 (instead of x86_64), and arm64 (instead of aarch64)
This commit is contained in:
Kaise Cheng 2025-06-23 14:13:17 +01:00
parent e2919ec284
commit 31775a2ff6
2 changed files with 19 additions and 1 deletions

View file

@ -29,6 +29,9 @@ rake artifact:dockerfiles || error "artifact:dockerfiles build failed."
STACK_VERSION="$(./$(dirname "$0")/../common/qualified-version.sh)"
info "Build complete, setting STACK_VERSION to $STACK_VERSION."
# standardize $ARCH for image name
normalize_arch
info "Saving tar.gz for docker images"
save_docker_tarballs "${ARCH}" "${STACK_VERSION}"
@ -44,7 +47,7 @@ done
# Upload 'docker-build-context.tar.gz' files only when build x86_64, otherwise they will be
# overwritten when building aarch64 (or viceversa).
if [ "$ARCH" != "aarch64" ]; then
if [ "$ARCH" != "arm64" ]; then
for image in logstash logstash-oss logstash-wolfi logstash-ironbank; do
buildkite-agent artifact upload "build/${image}-${STACK_VERSION}-docker-build-context.tar.gz"
done

View file

@ -22,6 +22,21 @@ function save_docker_tarballs {
done
}
# normalized $ARCH should be either "amd64" or "arm64"
function normalize_arch {
case "$ARCH" in
x86_64|amd64)
ARCH="amd64"
;;
aarch64|arm64)
ARCH="arm64"
;;
*)
error "Unsupported architecture: $ARCH"
;;
esac
}
# Since we are using the system jruby, we need to make sure our jvm process
# uses at least 1g of memory, If we don't do this we can get OOM issues when
# installing gems. See https://github.com/elastic/logstash/issues/5179