Skip to content

Commit

Permalink
Backport PR #14780 to 7.17: [DRA] Avoid to loose err code on docker s…
Browse files Browse the repository at this point in the history
…ave #14785

* [DRA] Force docker save to save directly on file instead of pipe to another command loosing the execution error code

(cherry picked from commit 2e5e49d)

Co-authored-by: Andrea Selva <[email protected]>
  • Loading branch information
github-actions[bot] and andsel authored Nov 29, 2022
1 parent 3822b60 commit dac65a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ci/dra_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ 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 "docker.elastic.co/logstash/${image}:${version}" | gzip -c > "build/${image}-${version}-docker-image-${arch}.tar.gz"
docker save -o "build/${image}-${version}-docker-image-${arch}.tar" \
"docker.elastic.co/logstash/${image}:${version}" || \
error "Hit a problem in saving the Docker image for ${image}"
# NOTE: if docker save exited with non-zero the error log already exited the script
gzip "build/${image}-${version}-docker-image-${arch}.tar"
done
}

Expand Down

0 comments on commit dac65a4

Please sign in to comment.