File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed
Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -95,22 +95,15 @@ jobs:
9595 openshift_token : ${{ secrets.OPENSHIFT_TOKEN }}
9696 namespace : ${{ env.OPENSHIFT_NAMESPACE_TOOLS }}
9797
98- - name : Tag ci-latest as version (if new deployment)
99- if : needs.validate.outputs.tag_exists == 'false'
98+ - name : Check if image exists and tag if needed
10099 run : |
101- echo "Tagging ci-latest as ${{ inputs.version }}..."
102- oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
103- ${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
104-
105- - name : Verify image tag exists (if rollback)
106- if : needs.validate.outputs.tag_exists == 'true'
107- run : |
108- echo "Verifying image tag ${{ inputs.version }} exists..."
109- if ! oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
110- echo "Error: Image tag ${{ inputs.version }} does not exist"
111- exit 1
100+ if oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} get imagestreamtag ${{ env.IMAGE_NAME }}:${{ inputs.version }} &>/dev/null; then
101+ echo "Image tag ${{ inputs.version }} already exists - using existing image"
102+ else
103+ echo "Image tag ${{ inputs.version }} does not exist - tagging from ci-latest"
104+ oc -n ${{ env.OPENSHIFT_NAMESPACE_TOOLS }} tag \
105+ ${{ env.IMAGE_NAME }}:ci-latest ${{ env.IMAGE_NAME }}:${{ inputs.version }}
112106 fi
113- echo "Image tag ${{ inputs.version }} found - proceeding with rollback"
114107
115108 - name : Tag version as test
116109 run : |
You can’t perform that action at this time.
0 commit comments