Skip to content

Commit c1a71fa

Browse files
committed
Add 'latest' tag push in case of release
1 parent 051ab29 commit c1a71fa

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

scripts/buildkite/release/push-to-dockerhub.sh

+14-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ set -euox pipefail
55
TRIGGERED_BY=$(buildkite-agent meta-data get base-build)
66
NEW_GIT_TAG=$(buildkite-agent meta-data get release-version)
77
TEST_RC=$(buildkite-agent meta-data get test-rc)
8+
CABAL_VERSION=$(buildkite-agent meta-data get release-cabal-version)
89

910
if [ "$RELEASE" == "false" ]; then
1011
if [ "$TEST_RC" == "TRUE" ]; then
@@ -23,6 +24,8 @@ main_build=$(curl -H "Authorization: Bearer $BUILDKITE_API_TOKEN" \
2324

2425
mkdir -p artifacts
2526

27+
repo="cardano-foundation/cardano-wallet"
28+
2629
artifact() {
2730
local artifact_name=$1
2831
# shellcheck disable=SC2155
@@ -33,10 +36,19 @@ artifact() {
3336
curl -H "Authorization: Bearer $BUILDKITE_API_TOKEN" -L \
3437
-o "artifacts/$artifact_name" \
3538
"$artifact_value"
36-
local image_name="cardanofoundation/cardano-wallet:$TAG"
3739
docker login -u cfhal -p "$DOCKER_HUB_TOKEN"
3840
docker load -i "artifacts/$artifact_name"
39-
docker push "$image_name"
41+
local image_name="$repo:$TAG"
42+
if [ "$RELEASE" == "false" ]; then
43+
local loaded_image_name="$repo:$CABAL_VERSION"
44+
docker tag "$loaded_image_name" "$image_name"
45+
docker push "$image_name"
46+
else
47+
local latest_image_name="$repo:latest"
48+
docker push "$image_name"
49+
docker tag "$image_name" "$latest_image_name"
50+
docker push "$latest_image_name"
51+
fi
4052
}
4153

4254
artifact "cardano-wallet-$NEW_GIT_TAG-docker-image.tgz"

0 commit comments

Comments
 (0)