@@ -77,23 +77,29 @@ go install github.com/CycloneDX/cyclonedx-gomod/cmd/
[email protected] 7777
7878cd "$(/stackable/patchable --images-repo-root=src checkout opa ${PRODUCT})"
7979
80+ ORIGINAL_VERSION=${PRODUCT}
81+ NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
82+
83+ sed -i 's/var Version = "' ${ORIGINAL_VERSION}'"/var Version = "' ${NEW_VERSION}'"/g' v1/version/version.go
84+
8085# Create snapshot of the source code including custom patches
81- tar -czf /stackable/opa-${PRODUCT }-src.tar.gz .
86+ tar -czf /stackable/opa-${NEW_VERSION }-src.tar.gz .
8287
8388# Unfortunately, we need to create a dummy Git repository to allow cyclonedx-gomod to determine the version of OPA
8489rm .git
8590git init
8691git config user.email
"[email protected] " 8792git config user.name "Fake commiter"
8893git commit --allow-empty --message "Fake commit, so that we can create a tag"
89- git tag "v${PRODUCT }"
94+ git tag "v${NEW_VERSION }"
9095go build -o opa -buildmode=exe
9196# move artifact to /stackable/*/ to copy in final image
92- ~/go/bin/cyclonedx-gomod app -json -output-version 1.5 -output /stackable/opa/"opa_${PRODUCT}.cdx.json" -packages -files
97+ ~/go/bin/cyclonedx-gomod app -json -output-version 1.5 -output /stackable/opa/"opa_${NEW_VERSION}.cdx.json" -packages -files
98+ sed -i "s/${NEW_VERSION}/${ORIGINAL_VERSION}/g" /stackable/opa/"opa_${NEW_VERSION}.cdx.json"
9399# move artifact to /stackable/* to copy in final image
94100mv opa /stackable/opa/
95101# set correct groups
96- chmod -R g=u /stackable/opa /stackable/opa-${PRODUCT }-src.tar.gz
102+ chmod -R g=u /stackable/opa /stackable/opa-${NEW_VERSION }-src.tar.gz
97103EOF
98104
99105FROM stackable/image/vector
@@ -113,7 +119,7 @@ LABEL name="Open Policy Agent" \
113119COPY --chown=${STACKABLE_USER_UID}:0 opa/licenses /licenses
114120
115121COPY --from=opa-builder --chown=${STACKABLE_USER_UID}:0 /stackable/opa /stackable/opa
116- COPY --from=opa-builder --chown=${STACKABLE_USER_UID}:0 /stackable/opa-${PRODUCT}-src.tar.gz /stackable/opa-${PRODUCT}-src.tar.gz
122+ COPY --from=opa-builder --chown=${STACKABLE_USER_UID}:0 /stackable/opa-${PRODUCT}-stackable${RELEASE}- src.tar.gz /stackable/opa-${PRODUCT}-stackable${RELEASE }-src.tar.gz
117123COPY --from=multilog-builder --chown=${STACKABLE_USER_UID}:0 /daemontools/admin/daemontools/command/multilog /stackable/multilog
118124
119125RUN <<EOF
0 commit comments