Skip to content

Commit 0f0796e

Browse files
weskubo-cgiweskubo-cgi
weskubo-cgi
authored and
weskubo-cgi
committed
Added explicit tag selection and input summary to workflows higher than Dev.
Added input summary to tag workflow.
1 parent f4c827b commit 0f0796e

9 files changed

+100
-47
lines changed

.github/workflows/create-git-and-image-tag.yml

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ jobs:
2626
environment: dev
2727

2828
steps:
29+
- name: Print Workflow Dispatch Inputs and Env Vars
30+
uses: shayki5/print-workflow-dispatch-inputs@v1
31+
with:
32+
add_to_summary: 'true'
33+
print_env_vars: 'false'
2934
- name: Check out repository
3035
uses: actions/checkout@v3
3136

.github/workflows/deploy-to-openshift-backend-efx.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ env:
4040

4141
on:
4242
workflow_dispatch:
43+
inputs:
44+
tag:
45+
description: 'The image tag to deploy'
46+
required: true
47+
type: string
4348

4449
jobs:
4550
openshift-ci-cd:
@@ -52,6 +57,11 @@ jobs:
5257
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
5358

5459
steps:
60+
- name: Print Workflow Dispatch Inputs and Env Vars
61+
uses: shayki5/print-workflow-dispatch-inputs@v1
62+
with:
63+
add_to_summary: 'true'
64+
print_env_vars: 'false'
5565
- name: Check for required secrets
5666
uses: actions/github-script@v6
5767
with:
@@ -95,10 +105,6 @@ jobs:
95105
with:
96106
ref: ${{ env.BRANCH }}
97107

98-
- name: Get latest tag
99-
uses: actions-ecosystem/action-get-latest-tag@v1
100-
id: get-latest-tag
101-
102108
- name: Install oc
103109
uses: redhat-actions/openshift-tools-installer@v1
104110
with:
@@ -118,15 +124,15 @@ jobs:
118124
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
119125
120126
# Create tag for UAT env from DEV env image
121-
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }}
127+
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }}
122128
123129
# Process and apply deployment template
124130
oc process -f tools/openshift/backend.dc.yaml \
125131
-p APP_NAME=${{ env.APP_NAME }} \
126132
-p REPO_NAME=${{ env.REPO_NAME }} \
127133
-p BRANCH=${{ env.BRANCH }} \
128134
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
129-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
135+
-p TAG=${{ inputs.tag }} \
130136
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
131137
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
132138
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-backend-prod.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ env:
3838

3939
on:
4040
workflow_dispatch:
41+
inputs:
42+
tag:
43+
description: 'The image tag to deploy'
44+
required: true
45+
type: string
4146

4247
jobs:
4348
openshift-ci-cd:
@@ -50,6 +55,11 @@ jobs:
5055
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
5156

5257
steps:
58+
- name: Print Workflow Dispatch Inputs and Env Vars
59+
uses: shayki5/print-workflow-dispatch-inputs@v1
60+
with:
61+
add_to_summary: 'true'
62+
print_env_vars: 'false'
5363
- name: Check for required secrets
5464
uses: actions/github-script@v6
5565
with:
@@ -93,10 +103,6 @@ jobs:
93103
with:
94104
ref: ${{ env.BRANCH }}
95105

96-
- name: Get latest tag
97-
uses: actions-ecosystem/action-get-latest-tag@v1
98-
id: get-latest-tag
99-
100106
- name: Install oc
101107
uses: redhat-actions/openshift-tools-installer@v1
102108
with:
@@ -116,15 +122,15 @@ jobs:
116122
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
117123
118124
# Create tag for PROD env from DEV env image
119-
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }}
125+
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }}
120126
121127
# Process and apply deployment template
122128
oc process -f tools/openshift/backend-tls.dc.yaml \
123129
-p APP_NAME=${{ env.APP_NAME }} \
124130
-p REPO_NAME=${{ env.REPO_NAME }} \
125131
-p BRANCH=${{ env.BRANCH }} \
126132
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
127-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
133+
-p TAG=${{ inputs.tag }} \
128134
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
129135
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
130136
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-backend-test.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ env:
3939

4040
on:
4141
workflow_dispatch:
42+
inputs:
43+
tag:
44+
description: 'The image tag to deploy'
45+
required: true
46+
type: string
4247

4348
jobs:
4449
openshift-ci-cd:
@@ -51,6 +56,11 @@ jobs:
5156
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
5257

5358
steps:
59+
- name: Print Workflow Dispatch Inputs and Env Vars
60+
uses: shayki5/print-workflow-dispatch-inputs@v1
61+
with:
62+
add_to_summary: 'true'
63+
print_env_vars: 'false'
5464
- name: Check for required secrets
5565
uses: actions/github-script@v6
5666
with:
@@ -94,10 +104,6 @@ jobs:
94104
with:
95105
ref: ${{ env.BRANCH }}
96106

97-
- name: Get latest tag
98-
uses: actions-ecosystem/action-get-latest-tag@v1
99-
id: get-latest-tag
100-
101107
- name: Install oc
102108
uses: redhat-actions/openshift-tools-installer@v1
103109
with:
@@ -114,7 +120,7 @@ jobs:
114120
|| true && echo "No rollout in progress"
115121
116122
# Create tag for TEST env from DEV env image
117-
# oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.BRANCH }}:${{ steps.get-latest-tag.outputs.tag }}
123+
# oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.BRANCH }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}-${{ env.BRANCH }}:${{ inputs.tag }}
118124
119125
# Process and apply deployment template
120126
oc process \
@@ -123,7 +129,7 @@ jobs:
123129
-p REPO_NAME=${{ env.REPO_NAME }} \
124130
-p BRANCH=${{ env.BRANCH }} \
125131
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
126-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
132+
-p TAG=${{ inputs.tag}} \
127133
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
128134
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
129135
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-backend-uat.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ env:
4040

4141
on:
4242
workflow_dispatch:
43+
inputs:
44+
tag:
45+
description: 'The image tag to deploy'
46+
required: true
47+
type: string
4348

4449
jobs:
4550
openshift-ci-cd:
@@ -52,6 +57,11 @@ jobs:
5257
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
5358

5459
steps:
60+
- name: Print Workflow Dispatch Inputs and Env Vars
61+
uses: shayki5/print-workflow-dispatch-inputs@v1
62+
with:
63+
add_to_summary: 'true'
64+
print_env_vars: 'false'
5565
- name: Check for required secrets
5666
uses: actions/github-script@v6
5767
with:
@@ -95,10 +105,6 @@ jobs:
95105
with:
96106
ref: ${{ env.BRANCH }}
97107

98-
- name: Get latest tag
99-
uses: actions-ecosystem/action-get-latest-tag@v1
100-
id: get-latest-tag
101-
102108
- name: Install oc
103109
uses: redhat-actions/openshift-tools-installer@v1
104110
with:
@@ -118,15 +124,15 @@ jobs:
118124
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
119125
120126
# Create tag for UAT env from DEV env image
121-
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ steps.get-latest-tag.outputs.tag }}
127+
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_BACKEND }}:${{ inputs.tag }}
122128
123129
# Process and apply deployment template
124130
oc process -f tools/openshift/backend.dc.yaml \
125131
-p APP_NAME=${{ env.APP_NAME }} \
126132
-p REPO_NAME=${{ env.REPO_NAME }} \
127133
-p BRANCH=${{ env.BRANCH }} \
128134
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
129-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
135+
-p TAG=${{ inputs.tag}} \
130136
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
131137
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
132138
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-frontend-efx.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ env:
4848

4949
on:
5050
workflow_dispatch:
51+
inputs:
52+
tag:
53+
description: 'The image tag to deploy'
54+
required: true
55+
type: string
5156

5257
jobs:
5358
openshift-ci-cd:
@@ -60,6 +65,11 @@ jobs:
6065
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
6166

6267
steps:
68+
- name: Print Workflow Dispatch Inputs and Env Vars
69+
uses: shayki5/print-workflow-dispatch-inputs@v1
70+
with:
71+
add_to_summary: 'true'
72+
print_env_vars: 'false'
6373
- name: Check for required secrets
6474
uses: actions/github-script@v6
6575
with:
@@ -103,10 +113,6 @@ jobs:
103113
with:
104114
ref: ${{ env.BRANCH }}
105115

106-
- name: Get latest tag
107-
uses: actions-ecosystem/action-get-latest-tag@v1
108-
id: get-latest-tag
109-
110116
- name: Install oc
111117
uses: redhat-actions/openshift-tools-installer@v1
112118
with:
@@ -126,7 +132,7 @@ jobs:
126132
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "frontend image stream in place"
127133
128134
# Create tag for EFX env from DEV env image
129-
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ steps.get-latest-tag.outputs.tag }}
135+
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-test/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ inputs.tag }}
130136
131137
# Process and apply deployment template
132138
oc process \
@@ -135,7 +141,7 @@ jobs:
135141
-p REPO_NAME=${{ env.REPO_NAME }} \
136142
-p BRANCH=${{ env.BRANCH }} \
137143
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
138-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
144+
-p TAG=${{ inputs.tag }} \
139145
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
140146
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
141147
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-frontend-prod.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ env:
4343

4444
on:
4545
workflow_dispatch:
46+
inputs:
47+
tag:
48+
description: 'The image tag to deploy'
49+
required: true
50+
type: string
4651

4752
jobs:
4853
openshift-ci-cd:
@@ -55,6 +60,11 @@ jobs:
5560
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
5661

5762
steps:
63+
- name: Print Workflow Dispatch Inputs and Env Vars
64+
uses: shayki5/print-workflow-dispatch-inputs@v1
65+
with:
66+
add_to_summary: 'true'
67+
print_env_vars: 'false'
5868
- name: Check for required secrets
5969
uses: actions/github-script@v6
6070
with:
@@ -98,10 +108,6 @@ jobs:
98108
with:
99109
ref: ${{ env.BRANCH }}
100110

101-
- name: Get latest tag
102-
uses: actions-ecosystem/action-get-latest-tag@v1
103-
id: get-latest-tag
104-
105111
- name: Install oc
106112
uses: redhat-actions/openshift-tools-installer@v1
107113
with:
@@ -121,7 +127,7 @@ jobs:
121127
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "frontend image stream in place"
122128
123129
# Create tag for PROD env from DEV env image
124-
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ steps.get-latest-tag.outputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ steps.get-latest-tag.outputs.tag }}
130+
oc tag ${{ env.NAMESPACE }}-dev/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ inputs.tag }} ${{ env.NAMESPACE }}-prod/${{ env.REPO_NAME }}-${{ env.APP_NAME_FRONTEND }}:${{ inputs.tag }}
125131
126132
# Process and apply deployment template
127133
oc process \
@@ -130,7 +136,7 @@ jobs:
130136
-p REPO_NAME=${{ env.REPO_NAME }} \
131137
-p BRANCH=${{ env.BRANCH }} \
132138
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
133-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
139+
-p TAG=${{ inputs.tag }} \
134140
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
135141
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
136142
-p MIN_CPU=${{ env.MIN_CPU }} \

.github/workflows/deploy-to-openshift-frontend-test.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ env:
4747

4848
on:
4949
workflow_dispatch:
50+
inputs:
51+
tag:
52+
description: 'The image tag to deploy'
53+
required: true
54+
type: string
5055

5156
jobs:
5257
openshift-ci-cd:
@@ -59,6 +64,11 @@ jobs:
5964
SELECTOR: ${{ steps.deploy-and-expose.outputs.selector }}
6065

6166
steps:
67+
- name: Print Workflow Dispatch Inputs and Env Vars
68+
uses: shayki5/print-workflow-dispatch-inputs@v1
69+
with:
70+
add_to_summary: 'true'
71+
print_env_vars: 'false'
6272
- name: Check for required secrets
6373
uses: actions/github-script@v6
6474
with:
@@ -102,10 +112,6 @@ jobs:
102112
with:
103113
ref: ${{ env.BRANCH }}
104114

105-
- name: Get latest tag
106-
uses: actions-ecosystem/action-get-latest-tag@v1
107-
id: get-latest-tag
108-
109115
- name: Install oc
110116
uses: redhat-actions/openshift-tools-installer@v1
111117
with:
@@ -128,7 +134,7 @@ jobs:
128134
-p REPO_NAME=${{ env.REPO_NAME }} \
129135
-p BRANCH=${{ env.BRANCH }} \
130136
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
131-
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
137+
-p TAG=${{ inputs.tag }} \
132138
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
133139
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
134140
-p MIN_CPU=${{ env.MIN_CPU }} \

0 commit comments

Comments
 (0)