Skip to content

Commit

Permalink
force deploy on test
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanfandevops committed Dec 17, 2024
1 parent 6d568c7 commit 72c1932
Showing 1 changed file with 90 additions and 83 deletions.
173 changes: 90 additions & 83 deletions .github/workflows/emergency-release-build-1.64.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,94 +22,95 @@ concurrency:
cancel-in-progress: true

jobs:
install-oc:
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
steps:
- name: Set up cache for OpenShift CLI
id: cache
uses: actions/[email protected]
with:
path: /usr/local/bin/oc # Path where the `oc` binary will be installed
key: oc-cli-${{ runner.os }}

- name: Install OpenShift CLI (if not cached)
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz
tar -xvf openshift-client-linux.tar.gz
sudo mv oc kubectl /usr/local/bin/
oc version --client
- name: Confirm OpenShift CLI is Available
run: oc version --client

set-pre-release:
name: Calculate pre-release number
runs-on: ubuntu-latest
needs: [install-oc]
outputs:
PRE_RELEASE: ${{ steps.set-pre-release.outputs.PRE_RELEASE }}

steps:
- id: set-pre-release
run: |
echo "PRE_RELEASE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
build:
name: Build ZEVA on Openshift
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [set-pre-release]

env:
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}

steps:
- name: Check out repository
uses: actions/[email protected]
with:
ref: release-${{ ENV.VERSION }}

- name: Restore oc command from Cache
uses: actions/[email protected]
with:
path: /usr/local/bin/oc
key: oc-cli-${{ runner.os }}

- name: Log in to Openshift
uses: redhat-actions/[email protected]
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.TOOLS_NAMESPACE }}

- name: List ZEVA deployments on Test
run: |
helm -n ${{ env.TEST_NAMESPACE }} list
- name: Build ZEVA Backend
run: |
cd openshift/templates/backend
oc process -f ./backend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }}
oc start-build --wait=true zeva-backend-${{ env.VERSION }}-${{ env.PRE_RELEASE }}
- name: Build ZEVA Frontend
run: |
cd openshift/templates/frontend
oc process -f ./frontend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }}
oc start-build --wait=true zeva-frontend-${{ env.VERSION }}-${{ env.PRE_RELEASE }}
# install-oc:
# runs-on: ubuntu-latest
# outputs:
# cache-hit: ${{ steps.cache.outputs.cache-hit }}
# steps:
# - name: Set up cache for OpenShift CLI
# id: cache
# uses: actions/[email protected]
# with:
# path: /usr/local/bin/oc # Path where the `oc` binary will be installed
# key: oc-cli-${{ runner.os }}

# - name: Install OpenShift CLI (if not cached)
# if: steps.cache.outputs.cache-hit != 'true'
# run: |
# curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz
# tar -xvf openshift-client-linux.tar.gz
# sudo mv oc kubectl /usr/local/bin/
# oc version --client

# - name: Confirm OpenShift CLI is Available
# run: oc version --client

# set-pre-release:
# name: Calculate pre-release number
# runs-on: ubuntu-latest
# needs: [install-oc]
# outputs:
# PRE_RELEASE: ${{ steps.set-pre-release.outputs.PRE_RELEASE }}

# steps:
# - id: set-pre-release
# run: |
# echo "PRE_RELEASE=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

# build:
# name: Build ZEVA on Openshift
# runs-on: ubuntu-latest
# timeout-minutes: 60
# needs: [set-pre-release]

# env:
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}

# steps:
# - name: Check out repository
# uses: actions/[email protected]
# with:
# ref: release-${{ ENV.VERSION }}

# - name: Restore oc command from Cache
# uses: actions/[email protected]
# with:
# path: /usr/local/bin/oc
# key: oc-cli-${{ runner.os }}

# - name: Log in to Openshift
# uses: redhat-actions/[email protected]
# with:
# openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }}
# openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
# insecure_skip_tls_verify: true
# namespace: ${{ env.TOOLS_NAMESPACE }}

# - name: List ZEVA deployments on Test
# run: |
# helm -n ${{ env.TEST_NAMESPACE }} list

# - name: Build ZEVA Backend
# run: |
# cd openshift/templates/backend
# oc process -f ./backend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }}
# oc start-build --wait=true zeva-backend-${{ env.VERSION }}-${{ env.PRE_RELEASE }}

# - name: Build ZEVA Frontend
# run: |
# cd openshift/templates/frontend
# oc process -f ./frontend-bc-docker.yaml NAME=zeva SUFFIX=-${{ env.VERSION }}-${{ env.PRE_RELEASE }} VERSION=${{ env.VERSION }}-${{ env.PRE_RELEASE }} GIT_URL=${{ env.GIT_URL }} GIT_REF=release-${{ env.VERSION }} | oc apply --wait=true -f - -n ${{ env.TOOLS_NAMESPACE }}
# oc start-build --wait=true zeva-frontend-${{ env.VERSION }}-${{ env.PRE_RELEASE }}

deploy-on-test:
name: Deploy ZEVA on Test
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [set-pre-release, build]
# needs: [set-pre-release, build]

env:
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}
PRE_RELEASE: "20241217214026"

steps:
- name: Ask for approval for ZEVA Test deployment
Expand Down Expand Up @@ -155,6 +156,8 @@ jobs:
- name: Deploy on Zeva Test
run: |
pwd
ls
helm -n ${{ env.TEST_NAMESPACE }} list
cd zeva
helm -n ${{ env.TEST_NAMESPACE }} -f ./values-test.yaml upgrade --install zeva-test .
Expand All @@ -163,9 +166,11 @@ jobs:
name: Deploy ZEVA on Prod
runs-on: ubuntu-latest
timeout-minutes: 240
needs: [set-pre-release, deploy-on-test]
# needs: [set-pre-release, deploy-on-test]
needs: [deploy-on-test]
env:
PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}
# PRE_RELEASE: ${{ needs.set-pre-release.outputs.PRE_RELEASE }}
PRE_RELEASE: "20241217214026"
steps:

- name: Ask for approval for ZEVA Prod deployment
Expand Down Expand Up @@ -211,6 +216,8 @@ jobs:
- name: Deploy Zeva on Prod
run: |
pwd
ls
helm -n ${{ env.PROD_NAMESPACE }} list
cd zeva
helm -n ${{ env.PROD_NAMESPACE }} -f ./values-prod.yaml upgrade --install zeva-prod .

0 comments on commit 72c1932

Please sign in to comment.