Skip to content

Commit

Permalink
Backport PR #14786 to 8.5: Avoid to create and upload AARCH64 Docker …
Browse files Browse the repository at this point in the history
…images for UBI8 #14789

On ARM architecture UBI8 Docker images aren't created, so avoid to create empty tar.gz files.

(cherry picked from commit 7a39d97)

Co-authored-by: Andrea Selva <[email protected]>
  • Loading branch information
github-actions[bot] and andsel authored Nov 29, 2022
1 parent abdf373 commit 06074da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
15 changes: 11 additions & 4 deletions ci/dra_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ function error {
function save_docker_tarballs {
local arch="${1:?architecture required}"
local version="${2:?stack-version required}"
for image in logstash logstash-oss logstash-ubi8; do
docker save -o "build/${image}-${version}-docker-image-${arch}.tar" \
local images="logstash logstash-oss"
if [ "${arch}" != "aarch64" ]; then
# No logstash-ubi8 for AARCH64
images="logstash logstash-oss logstash-ubi8"
fi

for image in ${images}; do
tar_file="${image}-${version}-docker-image-${arch}.tar"
docker save -o "build/${tar_file}" \
"docker.elastic.co/logstash/${image}:${version}" || \
error "Hit a problem in saving the Docker image for ${image}"
error "Unable to save tar file ${tar_file} for ${image} image."
# NOTE: if docker save exited with non-zero the error log already exited the script
gzip "build/${image}-${version}-docker-image-${arch}.tar"
gzip "build/${tar_file}"
done
}

Expand Down
7 changes: 6 additions & 1 deletion ci/dra_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ for file in build/logstash-*; do shasum $file;done

info "UPLOADING TO INTERMEDIATE BUCKET"
# Note the deb, rpm tar.gz AARCH64 files generated has already been loaded by the dra_x86_64.sh
for image in logstash logstash-oss logstash-ubi8; do
images="logstash logstash-oss"
if [ "$ARCH" != "aarch64" ]; then
# No logstash-ubi8 for AARCH64
images="logstash logstash-oss logstash-ubi8"
fi
for image in ${images}; do
upload_to_bucket "build/$image-${STACK_VERSION}-docker-image-${ARCH}.tar.gz" ${STACK_VERSION}
done

Expand Down

0 comments on commit 06074da

Please sign in to comment.