@@ -24,12 +24,20 @@ inputs:
24
24
description : |
25
25
Stackable Data Platform version (eg: `24.7.0`)
26
26
default : 0.0.0-dev
27
+ extra-tag-data :
28
+ description : |
29
+ Extra data to include in the final image manifest tag (eg: `pr321`)
27
30
outputs :
28
31
image-manifest-tag :
29
32
description : |
30
33
Human-readable tag (usually the version) with architecture information,
31
34
for example: `3.4.1-stackable0.0.0-dev-amd64`
32
35
value : ${{ steps.image_info.outputs.IMAGE_MANIFEST_TAG }}
36
+ suggested-image-index-manifest-tag :
37
+ description : |
38
+ Human-readable tag (usually the version) without architecture information,
39
+ for example: `3.4.1-stackable0.0.0-dev`
40
+ value : ${{ steps.image_info.outputs.IMAGE_INDEX_MANIFEST_TAG }}
33
41
runs :
34
42
using : composite
35
43
steps :
@@ -61,16 +69,30 @@ runs:
61
69
BAKE_PRODUCT_VERSION : ${{ inputs.product-version }}
62
70
BAKE_CONFIG_FILE : ${{ inputs.bake-config-file }}
63
71
IMAGE_REPOSITORY : ${{ inputs.product-name }}
72
+ EXTRA_TAG_DATA : ${{ inputs.extra-tag-data }}
64
73
SDP_VERSION : ${{ inputs.sdp-version }}
65
74
shell : bash
66
75
run : |
67
76
set -euo pipefail
68
77
IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/get_architecture.sh")
69
78
79
+ # Will be either:
80
+ # - 3.9.2-stackable0.0.0-dev-arm64 or
81
+ # - 3.9.2-stackable0.0.0-dev-pr321-arm64
82
+ IMAGE_INDEX_MANIFEST_TAG="${SDP_VERSION}${EXTRA_TAG_DATA:+-$EXTRA_TAG_DATA}-${IMAGE_ARCH}"
83
+ echo "IMAGE_INDEX_MANIFEST_TAG=$IMAGE_INDEX_MANIFEST_TAG" | tee -a "$GITHUB_ENV"
84
+
85
+ # Validate that final tag is valid according to
86
+ # https://github.com/distribution/reference/blob/8c942b0459dfdcc5b6685581dd0a5a470f615bff/regexp.go#L68
87
+ if ! echo "$IMAGE_INDEX_MANIFEST_TAG" | grep --perl-regexp --quiet '^[\w][\w.-]{1,127}$'; then
88
+ >&2 echo "Encountered invalid image manifest tag: $IMAGE_INDEX_MANIFEST_TAG"
89
+ exit 1
90
+ fi
91
+
70
92
echo "::group::bake"
71
93
bake \
72
94
--product "$IMAGE_REPOSITORY=$BAKE_PRODUCT_VERSION" \
73
- --image-version "${SDP_VERSION}-${IMAGE_ARCH} " \
95
+ --image-version "$IMAGE_INDEX_MANIFEST_TAG " \
74
96
--architecture "linux/${IMAGE_ARCH}" \
75
97
--export-tags-file bake-target-tags \
76
98
--configuration "$BAKE_CONFIG_FILE" \
@@ -102,7 +124,9 @@ runs:
102
124
# Extract the image manifest tag from the bake-target-tags file
103
125
IMAGE_MANIFEST_TAG=$(cut -d : -f 2 < bake-target-tags)
104
126
[[ -n "$IMAGE_MANIFEST_TAG" ]]
127
+ [[ -n "$IMAGE_INDEX_MANIFEST_TAG" ]]
105
128
106
129
# Add the contents of the env variables to the GitHub output, so that it
107
130
# can be used as action outputs
108
131
echo "IMAGE_MANIFEST_TAG=$IMAGE_MANIFEST_TAG" | tee -a "$GITHUB_OUTPUT"
132
+ echo "IMAGE_INDEX_MANIFEST_TAG=$IMAGE_INDEX_MANIFEST_TAG" | tee -a "$GITHUB_OUTPUT"
0 commit comments