From b2287cb14ca90b6888f927f6d81a894226135358 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 15 May 2025 14:08:27 -0700 Subject: [PATCH 01/18] updated namespace --- .../workflows/build-push-form-handler.yaml | 54 +++++++++++++++++++ .github/workflows/build-push-writer.yaml | 54 +++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 .github/workflows/build-push-form-handler.yaml create mode 100644 .github/workflows/build-push-writer.yaml diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml new file mode 100644 index 00000000..93b69021 --- /dev/null +++ b/.github/workflows/build-push-form-handler.yaml @@ -0,0 +1,54 @@ +name: form-handler-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/form_handler/** + - .github/workflows/build-push-form-handler.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: form-handler + WORKING_DIRECTORY: ./python/form_handler + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build + uses: docker/build-push-action@v3 + with: + context: ${{ inputs.DOCKER_CONTEXT }} + file: ${{ inputs.DOCKER_FILE }} + push: false + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file diff --git a/.github/workflows/build-push-writer.yaml b/.github/workflows/build-push-writer.yaml new file mode 100644 index 00000000..18d14aaa --- /dev/null +++ b/.github/workflows/build-push-writer.yaml @@ -0,0 +1,54 @@ +name: writer-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/writer/** + - .github/workflows/build-push-writer.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: writer + WORKING_DIRECTORY: ./python/writer + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build + uses: docker/build-push-action@v3 + with: + context: ${{ inputs.DOCKER_CONTEXT }} + file: ${{ inputs.DOCKER_FILE }} + push: false + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From 0f1c1c0485eca4258ccca242c0474a528d37368b Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 15 May 2025 14:15:40 -0700 Subject: [PATCH 02/18] syntax --- .github/workflows/build-push-form-handler.yaml | 6 +++--- .github/workflows/build-push-writer.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml index 93b69021..6ddfeb3e 100644 --- a/.github/workflows/build-push-form-handler.yaml +++ b/.github/workflows/build-push-form-handler.yaml @@ -10,7 +10,7 @@ on: - .github/workflows/build-push-form-handler.yaml - trigger.txt workflow_dispatch: - + env: IMAGE_NAME: form-handler WORKING_DIRECTORY: ./python/form_handler @@ -47,8 +47,8 @@ jobs: - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file diff --git a/.github/workflows/build-push-writer.yaml b/.github/workflows/build-push-writer.yaml index 18d14aaa..bacea6f0 100644 --- a/.github/workflows/build-push-writer.yaml +++ b/.github/workflows/build-push-writer.yaml @@ -10,7 +10,7 @@ on: - .github/workflows/build-push-writer.yaml - trigger.txt workflow_dispatch: - + env: IMAGE_NAME: writer WORKING_DIRECTORY: ./python/writer @@ -47,8 +47,8 @@ jobs: - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From 7f698d2b58cb3cb5642e827483b963ea2653c855 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 15 May 2025 14:17:01 -0700 Subject: [PATCH 03/18] took out step --- .github/workflows/build-push-form-handler.yaml | 7 ------- .github/workflows/build-push-writer.yaml | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml index 6ddfeb3e..7200c493 100644 --- a/.github/workflows/build-push-form-handler.yaml +++ b/.github/workflows/build-push-form-handler.yaml @@ -37,13 +37,6 @@ jobs: echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" echo "Short SHA: $SHORT_SHA" - - name: Build - uses: docker/build-push-action@v3 - with: - context: ${{ inputs.DOCKER_CONTEXT }} - file: ${{ inputs.DOCKER_FILE }} - push: false - - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | diff --git a/.github/workflows/build-push-writer.yaml b/.github/workflows/build-push-writer.yaml index bacea6f0..fafd656e 100644 --- a/.github/workflows/build-push-writer.yaml +++ b/.github/workflows/build-push-writer.yaml @@ -36,14 +36,7 @@ jobs: run: | echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" echo "Short SHA: $SHORT_SHA" - - - name: Build - uses: docker/build-push-action@v3 - with: - context: ${{ inputs.DOCKER_CONTEXT }} - file: ${{ inputs.DOCKER_FILE }} - push: false - + - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | From 4d2a9e84db01e1b7335e0f6305d0858a5f0675e4 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 07:47:18 -0700 Subject: [PATCH 04/18] testing out repo --- .github/workflows/build-push-form-handler.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml index 7200c493..e8db6ee6 100644 --- a/.github/workflows/build-push-form-handler.yaml +++ b/.github/workflows/build-push-form-handler.yaml @@ -13,7 +13,7 @@ on: env: IMAGE_NAME: form-handler - WORKING_DIRECTORY: ./python/form_handler + WORKING_DIRECTORY: ./python REPO_KEY: af03 jobs: @@ -40,7 +40,7 @@ jobs: - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f form_handler/Dockerfile . - name: Docker Push to Artifactory run: | From c4eda8881d094e4b3f79166414c1c9263cbaa293 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 07:50:37 -0700 Subject: [PATCH 05/18] updated writer --- .github/workflows/build-push-writer.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-push-writer.yaml b/.github/workflows/build-push-writer.yaml index fafd656e..cb188013 100644 --- a/.github/workflows/build-push-writer.yaml +++ b/.github/workflows/build-push-writer.yaml @@ -13,7 +13,7 @@ on: env: IMAGE_NAME: writer - WORKING_DIRECTORY: ./python/writer + WORKING_DIRECTORY: ./python REPO_KEY: af03 jobs: @@ -36,11 +36,11 @@ jobs: run: | echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" echo "Short SHA: $SHORT_SHA" - + - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f writer/Dockerfile . - name: Docker Push to Artifactory run: | From f7b73fd82f8a15357127941327d768c5dea35da4 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 07:54:16 -0700 Subject: [PATCH 06/18] updated pipelines --- .github/workflows/build-push-geocodersvc.yaml | 47 +++++++++++++++++++ .github/workflows/build-push-ingestor.yaml | 47 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 .github/workflows/build-push-geocodersvc.yaml create mode 100644 .github/workflows/build-push-ingestor.yaml diff --git a/.github/workflows/build-push-geocodersvc.yaml b/.github/workflows/build-push-geocodersvc.yaml new file mode 100644 index 00000000..56b94108 --- /dev/null +++ b/.github/workflows/build-push-geocodersvc.yaml @@ -0,0 +1,47 @@ +name: geocodersvc-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/form_handler/** + - .github/workflows/build-push-geocodersvc.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: geocodersvc + WORKING_DIRECTORY: ./python + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f geocodersvc/Dockerfile . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file diff --git a/.github/workflows/build-push-ingestor.yaml b/.github/workflows/build-push-ingestor.yaml new file mode 100644 index 00000000..35203177 --- /dev/null +++ b/.github/workflows/build-push-ingestor.yaml @@ -0,0 +1,47 @@ +name: ingestor-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/form_handler/** + - .github/workflows/build-push-ingestor.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: ingestor + WORKING_DIRECTORY: ./python + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f ingestor/Dockerfile . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From e8830fc928a9cf56b3ee787776b74f0776ad7353 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 07:56:02 -0700 Subject: [PATCH 07/18] updated piepline --- .github/workflows/build-push-paybc.yaml | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build-push-paybc.yaml diff --git a/.github/workflows/build-push-paybc.yaml b/.github/workflows/build-push-paybc.yaml new file mode 100644 index 00000000..0157fb4e --- /dev/null +++ b/.github/workflows/build-push-paybc.yaml @@ -0,0 +1,47 @@ +name: paybc-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/paybc_api/** + - .github/workflows/build-push-paybc.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: paybc + WORKING_DIRECTORY: ./python + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f paybc_api/Dockerfile . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From 3a8e740dc090eafd2db743d4e6d19aed886ca10b Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 08:09:23 -0700 Subject: [PATCH 08/18] pipelines --- .github/workflows/build-push-geocodersvc.yaml | 2 +- .github/workflows/build-push-mail-net.yaml | 45 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-push-mail-net.yaml diff --git a/.github/workflows/build-push-geocodersvc.yaml b/.github/workflows/build-push-geocodersvc.yaml index 56b94108..4e6d1abd 100644 --- a/.github/workflows/build-push-geocodersvc.yaml +++ b/.github/workflows/build-push-geocodersvc.yaml @@ -6,7 +6,7 @@ on: paths: - python/*.py - python/common/** - - python/form_handler/** + - python/geocodersvc/** - .github/workflows/build-push-geocodersvc.yaml - trigger.txt workflow_dispatch: diff --git a/.github/workflows/build-push-mail-net.yaml b/.github/workflows/build-push-mail-net.yaml new file mode 100644 index 00000000..7bd733e4 --- /dev/null +++ b/.github/workflows/build-push-mail-net.yaml @@ -0,0 +1,45 @@ +name: paybc-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - "Java/README.md" + - "Java/mail-it/**" + - ".github/workflows/build-push-mail-net.yaml" + workflow_dispatch: + +env: + IMAGE_NAME: mail-net + WORKING_DIRECTORY: Java/mail-it/src + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From 3c52f8b03b173aacaf6fc41b48554649515ec245 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 08:11:00 -0700 Subject: [PATCH 09/18] updated pipelines --- .github/workflows/build-push-mail-net.yaml | 2 +- .github/workflows/build-push-validator.yaml | 47 +++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-push-validator.yaml diff --git a/.github/workflows/build-push-mail-net.yaml b/.github/workflows/build-push-mail-net.yaml index 7bd733e4..d85f6bba 100644 --- a/.github/workflows/build-push-mail-net.yaml +++ b/.github/workflows/build-push-mail-net.yaml @@ -1,4 +1,4 @@ -name: paybc-build-and-push-dev +name: mailnet-build-and-push-dev on: push: diff --git a/.github/workflows/build-push-validator.yaml b/.github/workflows/build-push-validator.yaml new file mode 100644 index 00000000..d945a121 --- /dev/null +++ b/.github/workflows/build-push-validator.yaml @@ -0,0 +1,47 @@ +name: validator-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - python/*.py + - python/common/** + - python/validator/** + - .github/workflows/build-push-validator.yaml + - trigger.txt + workflow_dispatch: + +env: + IMAGE_NAME: validator + WORKING_DIRECTORY: ./python + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f validator/Dockerfile . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From e3fe63eac94620b3d8250a8678bbac1bfe907ded Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 08:17:33 -0700 Subject: [PATCH 10/18] pipelines --- .../workflows/build-push-clamav-client.yaml | 45 +++++++++++++++++++ .github/workflows/build-push-web-form.yaml | 45 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/build-push-clamav-client.yaml create mode 100644 .github/workflows/build-push-web-form.yaml diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml new file mode 100644 index 00000000..7219f476 --- /dev/null +++ b/.github/workflows/build-push-clamav-client.yaml @@ -0,0 +1,45 @@ +name: clamav-client-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - "Java/README.md" + - "Java/clamav_client/**" + - .github/workflows/build-push-clamav-client.yaml + workflow_dispatch: + +env: + IMAGE_NAME: clamav-client + WORKING_DIRECTORY: Java/clamav_client + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file diff --git a/.github/workflows/build-push-web-form.yaml b/.github/workflows/build-push-web-form.yaml new file mode 100644 index 00000000..f6200199 --- /dev/null +++ b/.github/workflows/build-push-web-form.yaml @@ -0,0 +1,45 @@ +name: web-form-build-and-push-dev + +on: + push: + branches: [new-namespace] + paths: + - .github/workflows/build-push-web-form.yaml + - "Java/README.md" + - "web_app/**" + workflow_dispatch: + +env: + IMAGE_NAME: web-form + WORKING_DIRECTORY: ./web_app + REPO_KEY: af03 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Build Image + working-directory: ${{env.WORKING_DIRECTORY}} + run: | + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + + - name: Docker Push to Artifactory + run: | + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file From 5792842f0ad6b3129137ad17dc81100c6dda7abc Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 08:54:10 -0700 Subject: [PATCH 11/18] updated naming --- .github/workflows/build-push-clamav-client.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index 7219f476..eba21f05 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -10,7 +10,7 @@ on: workflow_dispatch: env: - IMAGE_NAME: clamav-client + IMAGE_NAME: clamav WORKING_DIRECTORY: Java/clamav_client REPO_KEY: af03 @@ -38,8 +38,8 @@ jobs: - name: Build Image working-directory: ${{env.WORKING_DIRECTORY}} run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev . + docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}-client:dev . - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}-client:dev \ No newline at end of file From 9dd5cfcc2477d73987c04faf26e9e54970417dc9 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Fri, 16 May 2025 09:18:43 -0700 Subject: [PATCH 12/18] took out old pipelines, added trivy --- .../workflows/build-push-clamav-client.yaml | 14 +++- .../workflows/build-push-form-handler.yaml | 14 +++- .github/workflows/build-push-geocodersvc.yaml | 47 ----------- .github/workflows/build-push-ingestor.yaml | 14 +++- .github/workflows/build-push-mail-net.yaml | 14 +++- .github/workflows/build-push-paybc.yaml | 14 +++- .github/workflows/build-push-validator.yaml | 14 +++- .github/workflows/build-push-web-form.yaml | 14 +++- .github/workflows/build-push-writer.yaml | 12 ++- .github/workflows/cd-workflow.yml | 78 ------------------- .github/workflows/ci-workflow.yml | 30 ------- .github/workflows/form_handler-cd.yml | 25 ------ .github/workflows/form_handler-ci.yml | 31 -------- .github/workflows/geocodersvc-cd.yml | 25 ------ .github/workflows/geocodersvc-ci.yml | 23 ------ .github/workflows/ingestor-cd.yml | 25 ------ .github/workflows/ingestor-ci.yml | 23 ------ .github/workflows/paybc-cd.yml | 25 ------ .github/workflows/paybc-ci.yml | 20 ----- .github/workflows/rsbh-dh-clamav-cd.yml | 49 ------------ .github/workflows/rsbh-dh-clamav-ci.yml | 29 ------- .github/workflows/rsbh-dh-mail-net-cd.yml | 48 ------------ .github/workflows/rsbh-dh-mail-net-ci.yml | 29 ------- .github/workflows/rsbh-dh-web-form-cd.yml | 50 ------------ .github/workflows/rsbh-dh-web-form-ci.yml | 35 --------- .github/workflows/validator-cd.yml | 24 ------ .github/workflows/validator-ci.yml | 20 ----- .github/workflows/writer-cd.yml | 25 ------ .github/workflows/writer-ci.yml | 20 ----- 29 files changed, 95 insertions(+), 696 deletions(-) delete mode 100644 .github/workflows/build-push-geocodersvc.yaml delete mode 100644 .github/workflows/cd-workflow.yml delete mode 100644 .github/workflows/ci-workflow.yml delete mode 100644 .github/workflows/form_handler-cd.yml delete mode 100644 .github/workflows/form_handler-ci.yml delete mode 100644 .github/workflows/geocodersvc-cd.yml delete mode 100644 .github/workflows/geocodersvc-ci.yml delete mode 100644 .github/workflows/ingestor-cd.yml delete mode 100644 .github/workflows/ingestor-ci.yml delete mode 100644 .github/workflows/paybc-cd.yml delete mode 100644 .github/workflows/paybc-ci.yml delete mode 100644 .github/workflows/rsbh-dh-clamav-cd.yml delete mode 100644 .github/workflows/rsbh-dh-clamav-ci.yml delete mode 100644 .github/workflows/rsbh-dh-mail-net-cd.yml delete mode 100644 .github/workflows/rsbh-dh-mail-net-ci.yml delete mode 100644 .github/workflows/rsbh-dh-web-form-cd.yml delete mode 100644 .github/workflows/rsbh-dh-web-form-ci.yml delete mode 100644 .github/workflows/validator-cd.yml delete mode 100644 .github/workflows/validator-ci.yml delete mode 100644 .github/workflows/writer-cd.yml delete mode 100644 .github/workflows/writer-ci.yml diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index eba21f05..bbd358e5 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -2,7 +2,7 @@ name: clamav-client-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - "Java/README.md" - "Java/clamav_client/**" @@ -42,4 +42,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}-client:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}-client:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}-client:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml index e8db6ee6..e3e1578b 100644 --- a/.github/workflows/build-push-form-handler.yaml +++ b/.github/workflows/build-push-form-handler.yaml @@ -2,7 +2,7 @@ name: form-handler-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - python/*.py - python/common/** @@ -44,4 +44,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-geocodersvc.yaml b/.github/workflows/build-push-geocodersvc.yaml deleted file mode 100644 index 4e6d1abd..00000000 --- a/.github/workflows/build-push-geocodersvc.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: geocodersvc-build-and-push-dev - -on: - push: - branches: [new-namespace] - paths: - - python/*.py - - python/common/** - - python/geocodersvc/** - - .github/workflows/build-push-geocodersvc.yaml - - trigger.txt - workflow_dispatch: - -env: - IMAGE_NAME: geocodersvc - WORKING_DIRECTORY: ./python - REPO_KEY: af03 - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Login to Artifactory - uses: docker/login-action@v1 - with: - registry: artifacts.developer.gov.bc.ca - username: ${{ secrets.ARTIFACTORY_USERNAME }} - password: ${{ secrets.ARTIFACTORY_PASSWORD }} - - # Get SHORT_SHA for the version - - name: Get short SHA - id: short_sha - run: | - echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" - echo "Short SHA: $SHORT_SHA" - - - name: Build Image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev -f geocodersvc/Dockerfile . - - - name: Docker Push to Artifactory - run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file diff --git a/.github/workflows/build-push-ingestor.yaml b/.github/workflows/build-push-ingestor.yaml index 35203177..4ba8482f 100644 --- a/.github/workflows/build-push-ingestor.yaml +++ b/.github/workflows/build-push-ingestor.yaml @@ -2,7 +2,7 @@ name: ingestor-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - python/*.py - python/common/** @@ -44,4 +44,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-mail-net.yaml b/.github/workflows/build-push-mail-net.yaml index d85f6bba..1a5cc174 100644 --- a/.github/workflows/build-push-mail-net.yaml +++ b/.github/workflows/build-push-mail-net.yaml @@ -2,7 +2,7 @@ name: mailnet-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - "Java/README.md" - "Java/mail-it/**" @@ -42,4 +42,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-paybc.yaml b/.github/workflows/build-push-paybc.yaml index 0157fb4e..5fb89b58 100644 --- a/.github/workflows/build-push-paybc.yaml +++ b/.github/workflows/build-push-paybc.yaml @@ -2,7 +2,7 @@ name: paybc-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - python/*.py - python/common/** @@ -44,4 +44,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-validator.yaml b/.github/workflows/build-push-validator.yaml index d945a121..2217076e 100644 --- a/.github/workflows/build-push-validator.yaml +++ b/.github/workflows/build-push-validator.yaml @@ -2,7 +2,7 @@ name: validator-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - python/*.py - python/common/** @@ -44,4 +44,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-web-form.yaml b/.github/workflows/build-push-web-form.yaml index f6200199..3bc17288 100644 --- a/.github/workflows/build-push-web-form.yaml +++ b/.github/workflows/build-push-web-form.yaml @@ -2,7 +2,7 @@ name: web-form-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - .github/workflows/build-push-web-form.yaml - "Java/README.md" @@ -42,4 +42,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/build-push-writer.yaml b/.github/workflows/build-push-writer.yaml index cb188013..6216c121 100644 --- a/.github/workflows/build-push-writer.yaml +++ b/.github/workflows/build-push-writer.yaml @@ -44,4 +44,14 @@ jobs: - name: Docker Push to Artifactory run: | - docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev \ No newline at end of file + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + format: 'table' + ignore-unfixed: true + limit-severities-for-sarif: true + severity: HIGH,CRITICAL \ No newline at end of file diff --git a/.github/workflows/cd-workflow.yml b/.github/workflows/cd-workflow.yml deleted file mode 100644 index b8193557..00000000 --- a/.github/workflows/cd-workflow.yml +++ /dev/null @@ -1,78 +0,0 @@ -name: cd-workflow - -on: - workflow_call: - inputs: - DOCKER_CONTEXT: - required: true - type: string - DOCKER_FILE: - required: true - type: string - DOCKER_IMAGE_NAME: - required: true - type: string - DOCKER_IMAGE_TAG: - required: false - type: string - default: latest - secrets: - DOCKER_REGISTRY_BE78D6: - required: true - DOCKER_USERNAME_BE78D6: - required: true - DOCKER_PASSWORD_BE78D6: - required: true - -jobs: - build: - runs-on: ubuntu-latest - # if: ${{ !( - # github.event.pull_request.head.ref =~ '^hotfixrelease/' || - # github.event.pull_request.head.ref =~ '^hotfix/' || - # github.event.pull_request.head.ref =~ '^dependabot/'|| - # github.event.pull_request.head.ref =~ '^feature/' - # )}} - # if: ${{ github.event.pull_request.head.ref =~ '^release/' }} - if: startsWith(github.event.pull_request.head.ref, 'release/') - steps: - - name: Checkout - uses: actions/checkout@v3 - -# - name: Setup -# uses: docker/setup-buildx-action@v2 -# with: -# install: true - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Tag - id: tag - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - tag_prefix: ${{ inputs.DOCKER_IMAGE_NAME }}=v - fetch_all_tags: true - - - name: Build & Push the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -f ${{ inputs.DOCKER_FILE }} ./${{ inputs.DOCKER_CONTEXT }} -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ inputs.DOCKER_IMAGE_NAME }}:latest - docker push ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ inputs.DOCKER_IMAGE_NAME }}:latest - - - name: Authenticate and set context for tools namespace - uses: redhat-actions/oc-login@v1.1.2 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL_SILVER }} - openshift_token: ${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }} - namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools" - - - name: Import new image in Openshift from Artifactory - run: | - oc import-image ${{ inputs.DOCKER_IMAGE_NAME }}:latest --confirm - diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml deleted file mode 100644 index 04672d18..00000000 --- a/.github/workflows/ci-workflow.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: ci-workflow - -on: - workflow_call: - inputs: - DOCKER_CONTEXT: - required: true - type: string - DOCKER_FILE: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup - uses: docker/setup-buildx-action@v2 - with: - install: true - - - name: Build - uses: docker/build-push-action@v3 - with: - context: ${{ inputs.DOCKER_CONTEXT }} - file: ${{ inputs.DOCKER_FILE }} - push: false diff --git a/.github/workflows/form_handler-cd.yml b/.github/workflows/form_handler-cd.yml deleted file mode 100644 index 93253d36..00000000 --- a/.github/workflows/form_handler-cd.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: form_handler-cd - -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/form_handler/** - - .github/workflows/form_handler-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/form_handler/Dockerfile - DOCKER_IMAGE_NAME: dh-form_handler - secrets: inherit diff --git a/.github/workflows/form_handler-ci.yml b/.github/workflows/form_handler-ci.yml deleted file mode 100644 index ce8ff36f..00000000 --- a/.github/workflows/form_handler-ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: form_handler-ci - -# on: -# push: -# branches_ignore: -# - master -# paths: -# - python/*.py -# - python/common/** -# - python/form_handler/** -# - .github/workflows/form_handler-ci.yml -# - trigger.txt - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/form_handler/** - - .github/workflows/form_handler-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/form_handler/Dockerfile diff --git a/.github/workflows/geocodersvc-cd.yml b/.github/workflows/geocodersvc-cd.yml deleted file mode 100644 index 70cc1c52..00000000 --- a/.github/workflows/geocodersvc-cd.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: geocodersvc-cd - -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/geocodersvc/** - - .github/workflows/geocodersvc-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/geocodersvc/Dockerfile - DOCKER_IMAGE_NAME: dh-geocodersvc - secrets: inherit diff --git a/.github/workflows/geocodersvc-ci.yml b/.github/workflows/geocodersvc-ci.yml deleted file mode 100644 index d0cdc356..00000000 --- a/.github/workflows/geocodersvc-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: geocodersvc-ci - -on: - # push: - # branches_ignore: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/geocodersvc/** - - .github/workflows/geocodersvc-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/geocodersvc/Dockerfile diff --git a/.github/workflows/ingestor-cd.yml b/.github/workflows/ingestor-cd.yml deleted file mode 100644 index 36cd62dd..00000000 --- a/.github/workflows/ingestor-cd.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: ingestor-cd - -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/ingestor/** - - .github/workflows/ingestor-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/ingestor/Dockerfile - DOCKER_IMAGE_NAME: dh-ingestor - secrets: inherit diff --git a/.github/workflows/ingestor-ci.yml b/.github/workflows/ingestor-ci.yml deleted file mode 100644 index 23f257b8..00000000 --- a/.github/workflows/ingestor-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: ingestor-ci - -on: - # push: - # branches_ignore: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/ingestor/** - - .github/workflows/ingestor-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/ingestor/Dockerfile diff --git a/.github/workflows/paybc-cd.yml b/.github/workflows/paybc-cd.yml deleted file mode 100644 index 77f5a83c..00000000 --- a/.github/workflows/paybc-cd.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: paybc-cd - -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/paybc_api/** - - .github/workflows/paybc-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/paybc_api/Dockerfile - DOCKER_IMAGE_NAME: dh-paybc - secrets: inherit diff --git a/.github/workflows/paybc-ci.yml b/.github/workflows/paybc-ci.yml deleted file mode 100644 index 744db4a5..00000000 --- a/.github/workflows/paybc-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: paybc-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/paybc_api/** - - .github/workflows/paybc-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/paybc_api/Dockerfile diff --git a/.github/workflows/rsbh-dh-clamav-cd.yml b/.github/workflows/rsbh-dh-clamav-cd.yml deleted file mode 100644 index 4b7eb77f..00000000 --- a/.github/workflows/rsbh-dh-clamav-cd.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: rsbc-dh-claimav-cd - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - "Java/README.md" - - "Java/clamav_client/**" - - ".github/workflows/rsbh-dh-clamav-*.yml" - -env: - DOCKER_FILE: Java/clamav_client/Dockerfile - DOCKER_IMAGE_NAME: dh-clamav-client - WORKING_DIRECTORY: Java/clamav_client - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build & Push the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . - docker push ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest - - - name: Authenticate and set context for tools namespace - uses: redhat-actions/oc-login@v1.1.2 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL_SILVER }} - openshift_token: ${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }} - namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools" - - - name: Import new image in Openshift from Artifactory - env: - IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }} - run: | - oc import-image $IMAGE_NAME:latest --confirm - diff --git a/.github/workflows/rsbh-dh-clamav-ci.yml b/.github/workflows/rsbh-dh-clamav-ci.yml deleted file mode 100644 index e70b4ee6..00000000 --- a/.github/workflows/rsbh-dh-clamav-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: rsbc-dh-claimav-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - "Java/README.md" - - "Java/clamav_client/**" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . \ No newline at end of file diff --git a/.github/workflows/rsbh-dh-mail-net-cd.yml b/.github/workflows/rsbh-dh-mail-net-cd.yml deleted file mode 100644 index 1ad2cce3..00000000 --- a/.github/workflows/rsbh-dh-mail-net-cd.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: rsbc-dh-mail-net-cd - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - "Java/README.md" - - "Java/mail-it/**" - - ".github/workflows/rsbh-dh-mail-net*.yml" -env: - DOCKER_FILE: Java/mail-it/src/Dockerfile - DOCKER_IMAGE_NAME: dh-mail-net - WORKING_DIRECTORY: Java/mail-it/src - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build & Push the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . - docker push ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest - - - name: Authenticate and set context for tools namespace - uses: redhat-actions/oc-login@v1.1.2 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL_SILVER }} - openshift_token: ${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }} - namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools" - - - name: Import new image in Openshift from Artifactory - env: - IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }} - run: | - oc import-image $IMAGE_NAME:latest --confirm - diff --git a/.github/workflows/rsbh-dh-mail-net-ci.yml b/.github/workflows/rsbh-dh-mail-net-ci.yml deleted file mode 100644 index 16cab4c2..00000000 --- a/.github/workflows/rsbh-dh-mail-net-ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: rsbc-dh-mail-net-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - "Java/README.md" - - "Java/mail-it/**" - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . \ No newline at end of file diff --git a/.github/workflows/rsbh-dh-web-form-cd.yml b/.github/workflows/rsbh-dh-web-form-cd.yml deleted file mode 100644 index 3a55fec3..00000000 --- a/.github/workflows/rsbh-dh-web-form-cd.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: rsbc-dh-web-form-cd - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - "Java/README.md" - - "web_app/**" - - ".github/workflows/rsbh-dh-web-form*.yml" - -env: - DOCKER_FILE: web_app/Dockerfile - DOCKER_IMAGE_NAME: dh-web-form - WORKING_DIRECTORY: web_app - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build & Push the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . - docker push ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest - - - name: Authenticate and set context for tools namespace - uses: redhat-actions/oc-login@v1.1.2 - with: - openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL_SILVER }} - openshift_token: ${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }} - namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools" - - - name: Import new image in Openshift from Artifactory - env: - IMAGE_NAME: ${{ env.DOCKER_IMAGE_NAME }} - run: | - oc import-image $IMAGE_NAME:latest --confirm - diff --git a/.github/workflows/rsbh-dh-web-form-ci.yml b/.github/workflows/rsbh-dh-web-form-ci.yml deleted file mode 100644 index c8743297..00000000 --- a/.github/workflows/rsbh-dh-web-form-ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: rsbc-dh-web-form-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - "Java/README.md" - - "web_app/**" - - ".github/workflows/rsbh-dh-web-form*.yml" - -env: - DOCKER_FILE: web_app/Dockerfile - DOCKER_IMAGE_NAME: dh-web-form - WORKING_DIRECTORY: web_app - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Login - uses: docker/login-action@v2 - with: - registry: ${{ secrets.DOCKER_REGISTRY_BE78D6 }} - username: ${{ secrets.DOCKER_USERNAME_BE78D6 }} - password: ${{ secrets.DOCKER_PASSWORD_BE78D6 }} - - - name: Build & Push the image - working-directory: ${{env.WORKING_DIRECTORY}} - run: | - docker build -t ${{ secrets.DOCKER_REGISTRY_BE78D6 }}/${{ env.DOCKER_IMAGE_NAME }}:latest . \ No newline at end of file diff --git a/.github/workflows/validator-cd.yml b/.github/workflows/validator-cd.yml deleted file mode 100644 index be32a751..00000000 --- a/.github/workflows/validator-cd.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: validator-cd -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/validator/** - - .github/workflows/validator-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/validator/Dockerfile - DOCKER_IMAGE_NAME: dh-validator - secrets: inherit diff --git a/.github/workflows/validator-ci.yml b/.github/workflows/validator-ci.yml deleted file mode 100644 index 3239311f..00000000 --- a/.github/workflows/validator-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: validator-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/validator/** - - .github/workflows/validator-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/validator/Dockerfile diff --git a/.github/workflows/writer-cd.yml b/.github/workflows/writer-cd.yml deleted file mode 100644 index 16767e10..00000000 --- a/.github/workflows/writer-cd.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: writer-cd - -on: - # push: - # branches: - # - master - pull_request: - types: [opened, reopened, edited, synchronize] - branches: - - master - paths: - - python/*.py - - python/common/** - - python/writer/** - - .github/workflows/writer-cd.yml - - trigger.txt - -jobs: - CD: - uses: ./.github/workflows/cd-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/writer/Dockerfile - DOCKER_IMAGE_NAME: dh-writer - secrets: inherit diff --git a/.github/workflows/writer-ci.yml b/.github/workflows/writer-ci.yml deleted file mode 100644 index b21c0ee0..00000000 --- a/.github/workflows/writer-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: writer-ci - -on: - pull_request: - types: [opened, reopened, edited, synchronize] - branches-ignore: - - master - paths: - - python/*.py - - python/common/** - - python/writer/** - - .github/workflows/writer-ci.yml - - trigger.txt - -jobs: - CI: - uses: ./.github/workflows/ci-workflow.yml - with: - DOCKER_CONTEXT: python - DOCKER_FILE: python/writer/Dockerfile From 2f2bb43d7a60329f2bc0759a5fe426f51c8e57eb Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 08:22:17 -0700 Subject: [PATCH 13/18] added gitops build step --- .../workflows/build-push-clamav-client.yaml | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index bbd358e5..8601f848 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -2,7 +2,7 @@ name: clamav-client-build-and-push-dev on: push: - branches: [master] + branches: [new-namespace] paths: - "Java/README.md" - "Java/clamav_client/**" @@ -13,6 +13,7 @@ env: IMAGE_NAME: clamav WORKING_DIRECTORY: Java/clamav_client REPO_KEY: af03 + BRANCH_NAME: develop jobs: build: @@ -52,4 +53,49 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag ccversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} API image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file From 0c7277ac233e96ee21516d701505d09dcd9335b2 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 08:26:35 -0700 Subject: [PATCH 14/18] updated env vars --- .github/workflows/build-push-clamav-client.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index 8601f848..62da0602 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -14,6 +14,7 @@ env: WORKING_DIRECTORY: Java/clamav_client REPO_KEY: af03 BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: From 874360daac4f300697d691bfb69109187266d74a Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 08:32:44 -0700 Subject: [PATCH 15/18] updated path --- .github/workflows/build-push-clamav-client.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index 62da0602..2a56b1e3 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -81,9 +81,9 @@ jobs: echo "Updating tag ccversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml - sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" values.yaml + sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../rsbc/values.yaml - git add . + git add ../rsbc/values.yaml git add ../deploy/${{ env.VALUES_FILE }}_values.yaml @@ -95,7 +95,7 @@ jobs: git add . - git commit -m "Update ${{ env.BRANCH_NAME }} API image tag" + git commit -m "Update ${{ env.BRANCH_NAME }} clamavclient image tag" # pull any changes git pull origin ${{ env.BRANCH_NAME }} From 36e908e77d8dc8f852da2ad3cf727fe6a8f6b0fb Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 08:36:48 -0700 Subject: [PATCH 16/18] updated path --- .github/workflows/build-push-clamav-client.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index 2a56b1e3..2c387453 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -81,9 +81,8 @@ jobs: echo "Updating tag ccversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml - sed -i "s/ccversion: .*/ccversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../rsbc/values.yaml - git add ../rsbc/values.yaml + git add . git add ../deploy/${{ env.VALUES_FILE }}_values.yaml From 82f07f3961f36013c1887dfe08c9a556f6df0aa5 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 08:46:49 -0700 Subject: [PATCH 17/18] added gitops build step --- .../workflows/build-push-clamav-client.yaml | 2 +- .../workflows/build-push-form-handler.yaml | 48 ++++++++++++++++++- .github/workflows/build-push-ingestor.yaml | 48 ++++++++++++++++++- .github/workflows/build-push-mail-net.yaml | 48 ++++++++++++++++++- .github/workflows/build-push-paybc.yaml | 48 ++++++++++++++++++- .github/workflows/build-push-validator.yaml | 48 ++++++++++++++++++- .github/workflows/build-push-web-form.yaml | 48 ++++++++++++++++++- 7 files changed, 283 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-push-clamav-client.yaml b/.github/workflows/build-push-clamav-client.yaml index 2c387453..74e5b716 100644 --- a/.github/workflows/build-push-clamav-client.yaml +++ b/.github/workflows/build-push-clamav-client.yaml @@ -2,7 +2,7 @@ name: clamav-client-build-and-push-dev on: push: - branches: [new-namespace] + branches: [master] paths: - "Java/README.md" - "Java/clamav_client/**" diff --git a/.github/workflows/build-push-form-handler.yaml b/.github/workflows/build-push-form-handler.yaml index e3e1578b..1395a60d 100644 --- a/.github/workflows/build-push-form-handler.yaml +++ b/.github/workflows/build-push-form-handler.yaml @@ -15,6 +15,8 @@ env: IMAGE_NAME: form-handler WORKING_DIRECTORY: ./python REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -54,4 +56,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag fhversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/fhversion: .*/fhversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} formhandler image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/build-push-ingestor.yaml b/.github/workflows/build-push-ingestor.yaml index 4ba8482f..3d742f7b 100644 --- a/.github/workflows/build-push-ingestor.yaml +++ b/.github/workflows/build-push-ingestor.yaml @@ -15,6 +15,8 @@ env: IMAGE_NAME: ingestor WORKING_DIRECTORY: ./python REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -54,4 +56,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag iversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/iversion: .*/iversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} ingestor image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/build-push-mail-net.yaml b/.github/workflows/build-push-mail-net.yaml index 1a5cc174..aa78df9a 100644 --- a/.github/workflows/build-push-mail-net.yaml +++ b/.github/workflows/build-push-mail-net.yaml @@ -13,6 +13,8 @@ env: IMAGE_NAME: mail-net WORKING_DIRECTORY: Java/mail-it/src REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -52,4 +54,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag mnversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/mnversion: .*/mnversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} mailnet image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/build-push-paybc.yaml b/.github/workflows/build-push-paybc.yaml index 5fb89b58..39f5091e 100644 --- a/.github/workflows/build-push-paybc.yaml +++ b/.github/workflows/build-push-paybc.yaml @@ -15,6 +15,8 @@ env: IMAGE_NAME: paybc WORKING_DIRECTORY: ./python REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -54,4 +56,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag pbcversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/pbcversion: .*/pbcversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} paybc image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/build-push-validator.yaml b/.github/workflows/build-push-validator.yaml index 2217076e..441fc534 100644 --- a/.github/workflows/build-push-validator.yaml +++ b/.github/workflows/build-push-validator.yaml @@ -15,6 +15,8 @@ env: IMAGE_NAME: validator WORKING_DIRECTORY: ./python REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -54,4 +56,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag vversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/vversion: .*/vversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} validator image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/build-push-web-form.yaml b/.github/workflows/build-push-web-form.yaml index 3bc17288..60a9760d 100644 --- a/.github/workflows/build-push-web-form.yaml +++ b/.github/workflows/build-push-web-form.yaml @@ -13,6 +13,8 @@ env: IMAGE_NAME: web-form WORKING_DIRECTORY: ./web_app REPO_KEY: af03 + BRANCH_NAME: develop + VALUES_FILE: dev jobs: build: @@ -52,4 +54,48 @@ jobs: format: 'table' ignore-unfixed: true limit-severities-for-sarif: true - severity: HIGH,CRITICAL \ No newline at end of file + severity: HIGH,CRITICAL + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Dev Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag wfversion: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/wfversion: .*/wfversion: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} webform image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file From 11b5fe19b530857034ee023f4a4fbc3e1f183e14 Mon Sep 17 00:00:00 2001 From: Jessica Stratton Date: Thu, 29 May 2025 10:28:36 -0700 Subject: [PATCH 18/18] added test and prod actions --- .github/workflows/push-to-prod.yaml | 123 ++++++++++++++++++++++++++++ .github/workflows/push-to-test.yaml | 117 ++++++++++++++++++++++++++ 2 files changed, 240 insertions(+) create mode 100644 .github/workflows/push-to-prod.yaml create mode 100644 .github/workflows/push-to-test.yaml diff --git a/.github/workflows/push-to-prod.yaml b/.github/workflows/push-to-prod.yaml new file mode 100644 index 00000000..d4ed08ca --- /dev/null +++ b/.github/workflows/push-to-prod.yaml @@ -0,0 +1,123 @@ +name: Push to Test + +on: + workflow_dispatch: + inputs: + application: + required: true + description: What application do you want to push to test? + type: choice + options: + - clamav-client + - form-handler + - ingestor + - mail-net + - paybc + - validator + - web-form + +env: + IMAGE_NAME: ${{ github.event.inputs.application }} + REPO_KEY: af03 + BRANCH_NAME: test + VALUES_FILE: test + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set Conditions + run: | + if [[ "${{ env.IMAGE_NAME }}" == "clamav-client" ]]; then + echo "IMAGE_PREFIX=cc" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "form-handler" ]]; then + echo "IMAGE_PREFIX=fh" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "ingestor" ]]; then + echo "IMAGE_PREFIX=i" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "mail-net" ]]; then + echo "IMAGE_PREFIX=mn" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "paybc" ]]; then + echo "IMAGE_PREFIX=pbc" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "validator" ]]; then + echo "IMAGE_PREFIX=v" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "web-form" ]]; then + echo "IMAGE_PREFIX=wf" >> $GITHUB_ENV + else + echo "Unknown application: ${{ env.IMAGE_NAME }}" + fi + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Backup Prod Image + run: | + docker pull artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod + docker tag artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod-backup + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod-backup + + - name: Docker Pull to Artifactory + run: | + docker pull artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:test + + - name: Docker Tag and Push to Artifactory + run: | + docker tag artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:test artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:prod + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Test Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag ${{ env.IMAGE_PREFIX }}version: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/${{ env.IMAGE_PREFIX }}version: .*/${{ env.IMAGE_PREFIX }}version: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file diff --git a/.github/workflows/push-to-test.yaml b/.github/workflows/push-to-test.yaml new file mode 100644 index 00000000..9a8372de --- /dev/null +++ b/.github/workflows/push-to-test.yaml @@ -0,0 +1,117 @@ +name: Push to Test + +on: + workflow_dispatch: + inputs: + application: + required: true + description: What application do you want to push to test? + type: choice + options: + - clamav-client + - form-handler + - ingestor + - mail-net + - paybc + - validator + - web-form + +env: + IMAGE_NAME: ${{ github.event.inputs.application }} + REPO_KEY: af03 + BRANCH_NAME: test + VALUES_FILE: test + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set Conditions + run: | + if [[ "${{ env.IMAGE_NAME }}" == "clamav-client" ]]; then + echo "IMAGE_PREFIX=cc" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "form-handler" ]]; then + echo "IMAGE_PREFIX=fh" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "ingestor" ]]; then + echo "IMAGE_PREFIX=i" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "mail-net" ]]; then + echo "IMAGE_PREFIX=mn" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "paybc" ]]; then + echo "IMAGE_PREFIX=pbc" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "validator" ]]; then + echo "IMAGE_PREFIX=v" >> $GITHUB_ENV + elif [[ "${{ env.IMAGE_NAME }}" == "web-form" ]]; then + echo "IMAGE_PREFIX=wf" >> $GITHUB_ENV + else + echo "Unknown application: ${{ env.IMAGE_NAME }}" + fi + + - name: Login to Artifactory + uses: docker/login-action@v1 + with: + registry: artifacts.developer.gov.bc.ca + username: ${{ secrets.ARTIFACTORY_USERNAME }} + password: ${{ secrets.ARTIFACTORY_PASSWORD }} + + # Get SHORT_SHA for the version + - name: Get short SHA + id: short_sha + run: | + echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" + echo "Short SHA: $SHORT_SHA" + + - name: Docker Pull to Artifactory + run: | + docker pull artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev + + - name: Docker Tag and Push to Artifactory + run: | + docker tag artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:dev artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:test + docker push artifacts.developer.gov.bc.ca/${{env.REPO_KEY}}-${{env.IMAGE_NAME}}/${{env.IMAGE_NAME}}:test + + - name: Set GitOps SSH Key + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.RSBC_SSH_KEY }} + + - name: Update Helm Test Values and Commit + id: helm + run: | + + echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " + + # Commit and push the changes + git config --global user.email "actions@github.com" + git config --global user.name "RSBC-APR GitHub Actions" + git clone -b ${{ env.BRANCH_NAME }} --single-branch git@github.com:bcgov-c/tenant-gitops-f0392a.git + + # Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test + + cd tenant-gitops-f0392a/charts + + # Update the Helm values file with the new image tag and version + DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time + echo "Updating tag ${{ env.IMAGE_PREFIX }}version: to ${{ steps.short_sha.outputs.SHORT_SHA }}" + + sed -i "s/${{ env.IMAGE_PREFIX }}version: .*/${{ env.IMAGE_PREFIX }}version: v-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml + + git add . + + git add ../deploy/${{ env.VALUES_FILE }}_values.yaml + + # Repackage Helm Chart + + cd gitops + + helm dependency build + + git add . + + git commit -m "Update ${{ env.BRANCH_NAME }} image tag" + + # pull any changes + git pull origin ${{ env.BRANCH_NAME }} + git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed \ No newline at end of file