From a553fda04a36ebeb7b3cc7f5a78c780c85ca2bfe Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 15:52:54 -0700 Subject: [PATCH 01/12] feat: adding oc install action --- action.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/action.yml b/action.yml index 2cb860a..4dfc6f1 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,7 @@ inputs: ### Typical / recommended oc_version: description: Non-default OpenShift version; e.g. 4.13 + default: "4.13" parameters: description: Template parameters/variables to pass (e.g. -p ZONE=...) post_rollout: @@ -105,16 +106,10 @@ runs: diff_branch: ${{ inputs.diff_branch }} # Override OpenShift version, if specified - - name: Override OpenShift version - if: ${{ inputs.oc_version }} - env: - OC: https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable-${{ inputs.oc_version }}/openshift-client-linux.tar.gz - shell: bash - working-directory: /usr/local/bin/ - run: | - # Override default OpenShift version (retry, resume) - (wget ${{ env.OC }} -qcO - | tar -xzvf - oc)|| !! - oc version + - name: Install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: ${{ inputs.oc_version }} # Process variables and inputs # Remote/override repo is required if one has been specified (input) From e2448a60a0c83069ad0846e2545d3c9f0ec62358 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 15:54:08 -0700 Subject: [PATCH 02/12] fix: fixing ocp installation --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 4dfc6f1..28f2e41 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,7 @@ inputs: ### Typical / recommended oc_version: description: Non-default OpenShift version; e.g. 4.13 - default: "4.13" + default: "4.13.0" parameters: description: Template parameters/variables to pass (e.g. -p ZONE=...) post_rollout: @@ -109,7 +109,7 @@ runs: - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: - oc: ${{ inputs.oc_version }} + ocp: ${{ inputs.oc_version }} # Process variables and inputs # Remote/override repo is required if one has been specified (input) From fb0d61952b0db06f6aa17f5d110b439f0e33e568 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 15:55:05 -0700 Subject: [PATCH 03/12] chore: changing back to oc from ocp --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 28f2e41..e5de02d 100644 --- a/action.yml +++ b/action.yml @@ -109,7 +109,7 @@ runs: - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: - ocp: ${{ inputs.oc_version }} + oc: ${{ inputs.oc_version }} # Process variables and inputs # Remote/override repo is required if one has been specified (input) From 9ce175372ba5dd70f9081ad38729505b82be518c Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 15:59:27 -0700 Subject: [PATCH 04/12] chore: testing params --- action.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index e5de02d..3b07baf 100644 --- a/action.yml +++ b/action.yml @@ -25,7 +25,6 @@ inputs: ### Typical / recommended oc_version: description: Non-default OpenShift version; e.g. 4.13 - default: "4.13.0" parameters: description: Template parameters/variables to pass (e.g. -p ZONE=...) post_rollout: @@ -108,8 +107,16 @@ runs: # Override OpenShift version, if specified - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 - with: - oc: ${{ inputs.oc_version }} + with: + kam: "latest" + oc: "3" + + # Installs the latest release of odo with the major version 2, and the minor version 0. + # This would install odo 2.0.3, but not odo 2.1.0. + odo: "2.0" + + # This exact version will install version 0.11.0 of Tekton, no other version. + tkn: "0.11.0" # Process variables and inputs # Remote/override repo is required if one has been specified (input) From 9718fd8de881d493de49276ad796a429dd177d72 Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 16:01:34 -0700 Subject: [PATCH 05/12] chore: version test --- action.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/action.yml b/action.yml index 3b07baf..eca51c8 100644 --- a/action.yml +++ b/action.yml @@ -109,14 +109,8 @@ runs: uses: redhat-actions/openshift-tools-installer@v1 with: kam: "latest" - oc: "3" - - # Installs the latest release of odo with the major version 2, and the minor version 0. - # This would install odo 2.0.3, but not odo 2.1.0. - odo: "2.0" - - # This exact version will install version 0.11.0 of Tekton, no other version. - tkn: "0.11.0" + oc: "4" + odo: "3.9" # Process variables and inputs # Remote/override repo is required if one has been specified (input) From 3a7c8847dcf2fb6867719daac285a1d40bbd310a Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 16:03:00 -0700 Subject: [PATCH 06/12] chore: changing ubuntu version for test --- .github/workflows/pr-open.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 0d13df0..15e1787 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -9,7 +9,7 @@ concurrency: jobs: deploys: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 timeout-minutes: 10 outputs: backend: ${{ steps.trigger.outputs.backend }} @@ -51,7 +51,7 @@ jobs: results: name: Results - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [deploys] steps: - run: | From e2b491a243bb180c3b82884beaee22a91eb2025e Mon Sep 17 00:00:00 2001 From: Paulo Gomes da Cruz Junior Date: Thu, 26 Sep 2024 16:04:38 -0700 Subject: [PATCH 07/12] chore: reading from param --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index eca51c8..ff8e853 100644 --- a/action.yml +++ b/action.yml @@ -109,7 +109,7 @@ runs: uses: redhat-actions/openshift-tools-installer@v1 with: kam: "latest" - oc: "4" + oc: ${{ inputs.oc_version || '4' }} odo: "3.9" # Process variables and inputs From 8db2b61ce1051b12e698a4ebd6bfe9c9b8244610 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:18:54 -0700 Subject: [PATCH 08/12] Test with ubuntu-24.04 --- .github/workflows/pr-closed.yml | 2 +- README.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index e6a38aa..8e9cb20 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -15,7 +15,7 @@ jobs: cleanup-openshift: name: Cleanup OpenShift if: "!github.event.pull_request.head.repo.fork" - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - name: Remove OpenShift artifacts diff --git a/README.md b/README.md index e953ea8..6517156 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Deploy a single template. Multiple GitHub secrets are used. ```yaml deploys: name: Deploys - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Deploys uses: bcgov-nr/action-deployer-openshift.yml@main @@ -126,7 +126,7 @@ Deploy multiple templates in parallel. Runs on pull requests (PRs). ```yaml deploys: name: Deploys -runs-on: ubuntu-latest +runs-on: ubuntu-24.04 strategy: matrix: name: [backend, database, frontend, init] @@ -170,7 +170,7 @@ Deploy and run a command (post hook). Matrix values reference `post_rollout`, ` ```yaml deploys: name: Deploys -runs-on: ubuntu-latest +runs-on: ubuntu-24.04 strategy: matrix: name: [database, frontend] @@ -205,7 +205,7 @@ Deploy a template and set the after deployment check to hit the **/health** endp ```yaml deploys: name: Deploys - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Deploys uses: bcgov-nr/action-deployer-openshift.yml@main From db381b0ed32f3f4cd204c2cdbd8f8de213959e1b Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:34:34 -0700 Subject: [PATCH 09/12] Use for cleanup --- .github/workflows/pr-closed.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 8e9cb20..fb4e3ab 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -18,6 +18,13 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: + - name: Install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + kam: "latest" + oc: '4' + odo: "3.9" + - name: Remove OpenShift artifacts run: | oc login --token=${{ secrets.OC_TOKEN }} --server=${{ vars.OC_SERVER }} From 706b6d2585c9d8d15e0724ea2c2be5166c5dfb2f Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:35:28 -0700 Subject: [PATCH 10/12] Use for cleanup --- .github/workflows/pr-closed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index fb4e3ab..2419576 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -22,7 +22,7 @@ jobs: uses: redhat-actions/openshift-tools-installer@v1 with: kam: "latest" - oc: '4' + oc: "4" odo: "3.9" - name: Remove OpenShift artifacts From 251205334cdbd9057d8bff1678d922d996129600 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:36:12 -0700 Subject: [PATCH 11/12] Test with less params --- .github/workflows/pr-closed.yml | 2 -- action.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 2419576..5b9f028 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -21,9 +21,7 @@ jobs: - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: - kam: "latest" oc: "4" - odo: "3.9" - name: Remove OpenShift artifacts run: | diff --git a/action.yml b/action.yml index ff8e853..f8842d7 100644 --- a/action.yml +++ b/action.yml @@ -108,9 +108,7 @@ runs: - name: Install CLI tools from OpenShift Mirror uses: redhat-actions/openshift-tools-installer@v1 with: - kam: "latest" oc: ${{ inputs.oc_version || '4' }} - odo: "3.9" # Process variables and inputs # Remote/override repo is required if one has been specified (input) From 9c800ac936b576da619467c32ff5299f6e5a8a3c Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Thu, 26 Sep 2024 16:38:27 -0700 Subject: [PATCH 12/12] Fix cleanup --- .github/workflows/pr-closed.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-closed.yml b/.github/workflows/pr-closed.yml index 5b9f028..48db815 100644 --- a/.github/workflows/pr-closed.yml +++ b/.github/workflows/pr-closed.yml @@ -18,10 +18,10 @@ jobs: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - name: Install CLI tools from OpenShift Mirror - uses: redhat-actions/openshift-tools-installer@v1 - with: - oc: "4" + - name: Install CLI tools from OpenShift Mirror + uses: redhat-actions/openshift-tools-installer@v1 + with: + oc: "4" - name: Remove OpenShift artifacts run: |