Skip to content

Commit

Permalink
Added explicit tag selection and input summary to workflows higher th…
Browse files Browse the repository at this point in the history
…an Dev.

Added input summary to tag workflow.
  • Loading branch information
weskubo-cgi authored and weskubo-cgi committed Nov 1, 2024
1 parent f4c827b commit 0f0796e
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 47 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/create-git-and-image-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
environment: dev

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check out repository
uses: actions/checkout@v3

Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-backend-efx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -95,10 +105,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -118,15 +124,15 @@ jobs:
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
# Create tag for UAT env from DEV env image
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 }}
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 }}
# Process and apply deployment template
oc process -f tools/openshift/backend.dc.yaml \
-p APP_NAME=${{ env.APP_NAME }} \
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag }} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-backend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -93,10 +103,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -116,15 +122,15 @@ jobs:
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
# Create tag for PROD env from DEV env image
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 }}
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 }}
# Process and apply deployment template
oc process -f tools/openshift/backend-tls.dc.yaml \
-p APP_NAME=${{ env.APP_NAME }} \
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag }} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-backend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -94,10 +104,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -114,7 +120,7 @@ jobs:
|| true && echo "No rollout in progress"
# Create tag for TEST env from DEV env image
# 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 }}
# 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 }}
# Process and apply deployment template
oc process \
Expand All @@ -123,7 +129,7 @@ jobs:
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag}} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-backend-uat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -95,10 +105,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -118,15 +124,15 @@ jobs:
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "backend image stream in place"
# Create tag for UAT env from DEV env image
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 }}
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 }}
# Process and apply deployment template
oc process -f tools/openshift/backend.dc.yaml \
-p APP_NAME=${{ env.APP_NAME }} \
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag}} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-frontend-efx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -103,10 +113,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -126,7 +132,7 @@ jobs:
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "frontend image stream in place"
# Create tag for EFX env from DEV env image
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 }}
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 }}
# Process and apply deployment template
oc process \
Expand All @@ -135,7 +141,7 @@ jobs:
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag }} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/deploy-to-openshift-frontend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -98,10 +108,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -121,7 +127,7 @@ jobs:
oc create imagestream ${{ env.IMAGE_NAME }} 2> /dev/null || true && echo "frontend image stream in place"
# Create tag for PROD env from DEV env image
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 }}
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 }}
# Process and apply deployment template
oc process \
Expand All @@ -130,7 +136,7 @@ jobs:
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag }} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/deploy-to-openshift-frontend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ env:

on:
workflow_dispatch:
inputs:
tag:
description: 'The image tag to deploy'
required: true
type: string

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

steps:
- name: Print Workflow Dispatch Inputs and Env Vars
uses: shayki5/print-workflow-dispatch-inputs@v1
with:
add_to_summary: 'true'
print_env_vars: 'false'
- name: Check for required secrets
uses: actions/github-script@v6
with:
Expand Down Expand Up @@ -102,10 +112,6 @@ jobs:
with:
ref: ${{ env.BRANCH }}

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
Expand All @@ -128,7 +134,7 @@ jobs:
-p REPO_NAME=${{ env.REPO_NAME }} \
-p BRANCH=${{ env.BRANCH }} \
-p NAMESPACE=${{ env.OPENSHIFT_NAMESPACE }} \
-p TAG=${{ steps.get-latest-tag.outputs.tag }} \
-p TAG=${{ inputs.tag }} \
-p MIN_REPLICAS=${{ env.MIN_REPLICAS }} \
-p MAX_REPLICAS=${{ env.MAX_REPLICAS }} \
-p MIN_CPU=${{ env.MIN_CPU }} \
Expand Down
Loading

0 comments on commit 0f0796e

Please sign in to comment.