-
Notifications
You must be signed in to change notification settings - Fork 518
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: backport package-docker-snapshot.sh script (#4424)
- Loading branch information
1 parent
c191426
commit c446e3a
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Build the docker image for the apm-server, retag and push it to the given docker registry | ||
# | ||
# Arguments: | ||
# - NEW_TAG, this is the tag for the docker image to be pushed. | ||
# - NEW_IMAGE, this is the docker image name to be pushed. | ||
# | ||
set -euo pipefail | ||
|
||
NEW_TAG=${1:?Docker tag is not set} | ||
NEW_IMAGE=${2:?Docker image is not set} | ||
|
||
export PLATFORMS='linux/amd64' | ||
export TYPE='docker' | ||
export SNAPSHOT='true' | ||
export IMAGE="docker.elastic.co/apm/apm-server" | ||
|
||
echo 'INFO: Build docker images' | ||
make release | ||
|
||
echo 'INFO: Get the just built docker image' | ||
TAG=$(docker images ${IMAGE} --format "{{.Tag}}" | head -1) | ||
|
||
echo "INFO: Retag docker image (${IMAGE}:${TAG})" | ||
docker tag "${IMAGE}:${TAG}" "${NEW_IMAGE}:${NEW_TAG}" | ||
|
||
echo "INFO: Push docker image (${NEW_IMAGE}:${NEW_TAG})" | ||
docker push "${NEW_IMAGE}:${NEW_TAG}" |