From 0e68bb03ad9a31ecd6c75e4fec30549a20461d30 Mon Sep 17 00:00:00 2001 From: Kuan Fan Date: Tue, 7 May 2024 11:06:26 -0700 Subject: [PATCH] update oc login --- .github/workflows/pr-build-template.yaml | 12 ++++------- .github/workflows/pr-deploy-template.yaml | 3 +-- .../archieve/pr-dev-database-template.yaml | 21 +++++++------------ openshift/templates/archieve/pr-teardown.yaml | 11 ++++------ 4 files changed, 17 insertions(+), 30 deletions(-) diff --git a/.github/workflows/pr-build-template.yaml b/.github/workflows/pr-build-template.yaml index e97fbdb7..cb1a90d2 100644 --- a/.github/workflows/pr-build-template.yaml +++ b/.github/workflows/pr-build-template.yaml @@ -36,8 +36,7 @@ jobs: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} @@ -63,8 +62,7 @@ jobs: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} @@ -90,8 +88,7 @@ jobs: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} @@ -117,8 +114,7 @@ jobs: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} diff --git a/.github/workflows/pr-deploy-template.yaml b/.github/workflows/pr-deploy-template.yaml index 542bda6f..41b6991c 100644 --- a/.github/workflows/pr-deploy-template.yaml +++ b/.github/workflows/pr-deploy-template.yaml @@ -52,8 +52,7 @@ jobs: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} diff --git a/openshift/templates/archieve/pr-dev-database-template.yaml b/openshift/templates/archieve/pr-dev-database-template.yaml index 6db599ce..4a8479af 100644 --- a/openshift/templates/archieve/pr-dev-database-template.yaml +++ b/openshift/templates/archieve/pr-dev-database-template.yaml @@ -8,42 +8,38 @@ on: type: string dev-suffix: required: true - type: string + type: string secrets: dev-namespace: required: true itvr-dev-username: required: true itvr-dev-password: - required: true + required: true openshift-server: - required: true - openshift-token: - required: true - -jobs: + required: true + openshift-token: + required: true +jobs: database: - name: Start Database runs-on: ubuntu-latest timeout-minutes: 60 steps: - - name: Check out repository uses: actions/checkout@v4 with: ref: refs/pull/${{ inputs.pr-number }}/head - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.openshift-server }} openshift_token: ${{ secrets.openshift-token }} insecure_skip_tls_verify: true - namespace: ${{ secrets.dev-namespace }} + namespace: ${{ secrets.dev-namespace }} - name: Setup Database shell: bash {0} @@ -65,4 +61,3 @@ jobs: oc -n ${{ secrets.dev-namespace }} exec itvr-spilo${{ inputs.dev-suffix }}-0 -- psql -c "ALTER SYSTEM SET log_checkpoints='off'" || true oc -n ${{ secrets.dev-namespace }} exec itvr-spilo${{ inputs.dev-suffix }}-0 -- psql -c "select pg_reload_conf()" || true fi - diff --git a/openshift/templates/archieve/pr-teardown.yaml b/openshift/templates/archieve/pr-teardown.yaml index a3a2f3f1..4b1c433b 100644 --- a/openshift/templates/archieve/pr-teardown.yaml +++ b/openshift/templates/archieve/pr-teardown.yaml @@ -4,30 +4,27 @@ on: pull_request: types: closed branches: - - 'release-*' + - "release-*" env: TOOLS_NAMESPACE: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools DEV_NAMESPACE: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-dev jobs: - teardown-on-dev: if: endsWith( github.event.pull_request.title, 'build-on-dev' ) name: Tear ITVR down on Dev runs-on: ubuntu-latest timeout-minutes: 20 - - steps: + steps: - name: Log in to Openshift - # uses: redhat-actions/oc-login@v1.3 - uses: smlgbl/oc-login@main + uses: redhat-actions/oc-login@v1.3 with: openshift_server_url: ${{ secrets.OPENSHIFT_SERVER }} openshift_token: ${{ secrets.OPENSHIFT_TOKEN }} insecure_skip_tls_verify: true - namespace: ${{ env.TOOLS_NAMESPACE }} + namespace: ${{ env.TOOLS_NAMESPACE }} - name: Undeploy on Dev shell: bash {0}