From d3e2243398df879ae984952cd370b38a8ca35ed1 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Wed, 6 Mar 2024 12:00:19 -0800 Subject: [PATCH] feat: helm deployer shared workflow_call (#1850) --- .github/workflows/.deploy.yml | 8 ------- .github/workflows/pr-open.yml | 21 ++++++++++++------- .../{quickstart-openshift => app}/.helmignore | 0 .../{quickstart-openshift => app}/Chart.lock | 0 .../{quickstart-openshift => app}/Chart.yaml | 0 .../{quickstart-openshift => app}/README.md | 0 .../README.md.gotmpl | 0 .../templates/_helpers.tpl | 0 .../templates/backend/templates/_helpers.tpl | 0 .../backend/templates/deployment.yaml | 0 .../templates/backend/templates/hpa.yaml | 0 .../templates/backend/templates/pdb.yaml | 0 .../templates/backend/templates/service.yaml | 0 .../templates/frontend/templates/_helpers.tpl | 0 .../frontend/templates/deployment.yaml | 0 .../templates/frontend/templates/hpa.yaml | 0 .../templates/frontend/templates/ingress.yaml | 0 .../templates/frontend/templates/pdb.yaml | 0 .../templates/frontend/templates/service.yaml | 0 .../templates/knp.yaml | 0 .../templates/secret.yaml | 0 .../{quickstart-openshift => app}/values.yaml | 0 22 files changed, 14 insertions(+), 15 deletions(-) rename charts/{quickstart-openshift => app}/.helmignore (100%) rename charts/{quickstart-openshift => app}/Chart.lock (100%) rename charts/{quickstart-openshift => app}/Chart.yaml (100%) rename charts/{quickstart-openshift => app}/README.md (100%) rename charts/{quickstart-openshift => app}/README.md.gotmpl (100%) rename charts/{quickstart-openshift => app}/templates/_helpers.tpl (100%) rename charts/{quickstart-openshift => app}/templates/backend/templates/_helpers.tpl (100%) rename charts/{quickstart-openshift => app}/templates/backend/templates/deployment.yaml (100%) rename charts/{quickstart-openshift => app}/templates/backend/templates/hpa.yaml (100%) rename charts/{quickstart-openshift => app}/templates/backend/templates/pdb.yaml (100%) rename charts/{quickstart-openshift => app}/templates/backend/templates/service.yaml (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/_helpers.tpl (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/deployment.yaml (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/hpa.yaml (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/ingress.yaml (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/pdb.yaml (100%) rename charts/{quickstart-openshift => app}/templates/frontend/templates/service.yaml (100%) rename charts/{quickstart-openshift => app}/templates/knp.yaml (100%) rename charts/{quickstart-openshift => app}/templates/secret.yaml (100%) rename charts/{quickstart-openshift => app}/values.yaml (100%) diff --git a/.github/workflows/.deploy.yml b/.github/workflows/.deploy.yml index c68adbce7..885045197 100644 --- a/.github/workflows/.deploy.yml +++ b/.github/workflows/.deploy.yml @@ -109,11 +109,3 @@ jobs: # Remove old build runs, build pods and deployment pods oc delete po --field-selector=status.phase==Succeeded - - tests: - name: Tests - needs: [deploys] - if: ${{ inputs.test == 'true' && inputs.build_outputs != '' }} - uses: ./.github/workflows/.tests.yml - with: - target: ${{ inputs.release }} diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index a9b8ade3a..d1e1e76b7 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -19,7 +19,7 @@ jobs: digest: ${{ steps.builds.outputs.digest }} strategy: matrix: - package: [migrations, backend, frontend] + package: [backend, frontend, migrations] timeout-minutes: 10 steps: - uses: bcgov-nr/action-builder-ghcr@v2.0.2 @@ -35,16 +35,23 @@ jobs: deploys: name: Deploys needs: [builds] - uses: ./.github/workflows/.deploy.yml - secrets: inherit + uses: bcgov/quickstart-openshift-helpers/.github/workflows/.deployer.yml@v0.4.0 + secrets: + oc_namespace: ${{ vars.OC_NAMESPACE }} + oc_token: ${{ secrets.OC_TOKEN }} with: - build_outputs: ${{ needs.builds.outputs.digest }} - tag: ${{ github.event.number }} - release: ${{ github.event.number }} + triggers: ('backend/', 'frontend/', 'migrations/') + + tests: + name: Tests + needs: [deploys] + uses: ./.github/workflows/.tests.yml + with: + target: ${{ github.event.number }} results: name: PR Results - needs: [deploys] + needs: [tests] runs-on: ubuntu-22.04 steps: - run: echo "Workflow completed successfully!" diff --git a/charts/quickstart-openshift/.helmignore b/charts/app/.helmignore similarity index 100% rename from charts/quickstart-openshift/.helmignore rename to charts/app/.helmignore diff --git a/charts/quickstart-openshift/Chart.lock b/charts/app/Chart.lock similarity index 100% rename from charts/quickstart-openshift/Chart.lock rename to charts/app/Chart.lock diff --git a/charts/quickstart-openshift/Chart.yaml b/charts/app/Chart.yaml similarity index 100% rename from charts/quickstart-openshift/Chart.yaml rename to charts/app/Chart.yaml diff --git a/charts/quickstart-openshift/README.md b/charts/app/README.md similarity index 100% rename from charts/quickstart-openshift/README.md rename to charts/app/README.md diff --git a/charts/quickstart-openshift/README.md.gotmpl b/charts/app/README.md.gotmpl similarity index 100% rename from charts/quickstart-openshift/README.md.gotmpl rename to charts/app/README.md.gotmpl diff --git a/charts/quickstart-openshift/templates/_helpers.tpl b/charts/app/templates/_helpers.tpl similarity index 100% rename from charts/quickstart-openshift/templates/_helpers.tpl rename to charts/app/templates/_helpers.tpl diff --git a/charts/quickstart-openshift/templates/backend/templates/_helpers.tpl b/charts/app/templates/backend/templates/_helpers.tpl similarity index 100% rename from charts/quickstart-openshift/templates/backend/templates/_helpers.tpl rename to charts/app/templates/backend/templates/_helpers.tpl diff --git a/charts/quickstart-openshift/templates/backend/templates/deployment.yaml b/charts/app/templates/backend/templates/deployment.yaml similarity index 100% rename from charts/quickstart-openshift/templates/backend/templates/deployment.yaml rename to charts/app/templates/backend/templates/deployment.yaml diff --git a/charts/quickstart-openshift/templates/backend/templates/hpa.yaml b/charts/app/templates/backend/templates/hpa.yaml similarity index 100% rename from charts/quickstart-openshift/templates/backend/templates/hpa.yaml rename to charts/app/templates/backend/templates/hpa.yaml diff --git a/charts/quickstart-openshift/templates/backend/templates/pdb.yaml b/charts/app/templates/backend/templates/pdb.yaml similarity index 100% rename from charts/quickstart-openshift/templates/backend/templates/pdb.yaml rename to charts/app/templates/backend/templates/pdb.yaml diff --git a/charts/quickstart-openshift/templates/backend/templates/service.yaml b/charts/app/templates/backend/templates/service.yaml similarity index 100% rename from charts/quickstart-openshift/templates/backend/templates/service.yaml rename to charts/app/templates/backend/templates/service.yaml diff --git a/charts/quickstart-openshift/templates/frontend/templates/_helpers.tpl b/charts/app/templates/frontend/templates/_helpers.tpl similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/_helpers.tpl rename to charts/app/templates/frontend/templates/_helpers.tpl diff --git a/charts/quickstart-openshift/templates/frontend/templates/deployment.yaml b/charts/app/templates/frontend/templates/deployment.yaml similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/deployment.yaml rename to charts/app/templates/frontend/templates/deployment.yaml diff --git a/charts/quickstart-openshift/templates/frontend/templates/hpa.yaml b/charts/app/templates/frontend/templates/hpa.yaml similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/hpa.yaml rename to charts/app/templates/frontend/templates/hpa.yaml diff --git a/charts/quickstart-openshift/templates/frontend/templates/ingress.yaml b/charts/app/templates/frontend/templates/ingress.yaml similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/ingress.yaml rename to charts/app/templates/frontend/templates/ingress.yaml diff --git a/charts/quickstart-openshift/templates/frontend/templates/pdb.yaml b/charts/app/templates/frontend/templates/pdb.yaml similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/pdb.yaml rename to charts/app/templates/frontend/templates/pdb.yaml diff --git a/charts/quickstart-openshift/templates/frontend/templates/service.yaml b/charts/app/templates/frontend/templates/service.yaml similarity index 100% rename from charts/quickstart-openshift/templates/frontend/templates/service.yaml rename to charts/app/templates/frontend/templates/service.yaml diff --git a/charts/quickstart-openshift/templates/knp.yaml b/charts/app/templates/knp.yaml similarity index 100% rename from charts/quickstart-openshift/templates/knp.yaml rename to charts/app/templates/knp.yaml diff --git a/charts/quickstart-openshift/templates/secret.yaml b/charts/app/templates/secret.yaml similarity index 100% rename from charts/quickstart-openshift/templates/secret.yaml rename to charts/app/templates/secret.yaml diff --git a/charts/quickstart-openshift/values.yaml b/charts/app/values.yaml similarity index 100% rename from charts/quickstart-openshift/values.yaml rename to charts/app/values.yaml