From 4dc30bbf9bc5a0005612e046f3ac8b13b1be4fe8 Mon Sep 17 00:00:00 2001 From: manuraf Date: Fri, 9 Feb 2024 16:41:43 +0100 Subject: [PATCH] other pipelines --- .github/workflows/release_functions.yml | 14 +++++++++++--- .github/workflows/release_ms.yml | 7 ------- .github/workflows/release_pnpg_functions.yml | 14 +++++++++++--- .github/workflows/release_pnpg_ms.yml | 14 +++++++++++--- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release_functions.yml b/.github/workflows/release_functions.yml index 2fde77fa0..10f15c3f3 100644 --- a/.github/workflows/release_functions.yml +++ b/.github/workflows/release_functions.yml @@ -11,13 +11,21 @@ on: - "pom.xml" workflow_dispatch: + inputs: + env: + type: choice + description: Environment + options: + - dev + - uat + - prod jobs: release_dev: uses: ./.github/workflows/call_release_function.yml name: '[Dev] OnBoarding function Release' - if: github.ref_name == 'main' + if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }} secrets: inherit with: environment: dev @@ -26,7 +34,7 @@ jobs: release_uat: uses: ./.github/workflows/call_release_function.yml name: '[UAT] OnBoarding function Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }} secrets: inherit with: environment: uat @@ -35,7 +43,7 @@ jobs: release_prod: uses: ./.github/workflows/call_release_function.yml name: '[Prod] OnBoarding function Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ inputs.env == 'prod' }} secrets: inherit with: environment: prod diff --git a/.github/workflows/release_ms.yml b/.github/workflows/release_ms.yml index c968b3f2c..520bc4a44 100644 --- a/.github/workflows/release_ms.yml +++ b/.github/workflows/release_ms.yml @@ -22,13 +22,6 @@ on: - prod jobs: - test: - runs-on: ubuntu-20.04 - steps: - - name: Print if - id: print-if - run: | - echo "${{startsWith(github.ref_name, 'releases/') != true && inputs.env == null }}" release_dev: uses: ./.github/workflows/call_release_ms.yml diff --git a/.github/workflows/release_pnpg_functions.yml b/.github/workflows/release_pnpg_functions.yml index 18cd70dbe..4d951aa1c 100644 --- a/.github/workflows/release_pnpg_functions.yml +++ b/.github/workflows/release_pnpg_functions.yml @@ -11,13 +11,21 @@ on: - "pom.xml" workflow_dispatch: + inputs: + env: + type: choice + description: Environment + options: + - dev + - uat + - prod jobs: release_dev: uses: ./.github/workflows/call_release_function.yml name: '[Dev] OnBoarding function Release' - if: startsWith(github.ref_name, 'releases/') != true + if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }} secrets: inherit with: environment: dev @@ -26,7 +34,7 @@ jobs: release_uat: uses: ./.github/workflows/call_release_function.yml name: '[UAT] OnBoarding function Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }} secrets: inherit with: environment: uat @@ -35,7 +43,7 @@ jobs: release_prod: uses: ./.github/workflows/call_release_function.yml name: '[Prod] OnBoarding function Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ inputs.env == 'prod' }} secrets: inherit with: environment: prod diff --git a/.github/workflows/release_pnpg_ms.yml b/.github/workflows/release_pnpg_ms.yml index 166768bb2..02e009b87 100644 --- a/.github/workflows/release_pnpg_ms.yml +++ b/.github/workflows/release_pnpg_ms.yml @@ -12,13 +12,21 @@ on: - "pom.xml" workflow_dispatch: + inputs: + env: + type: choice + description: Environment + options: + - dev + - uat + - prod jobs: release_dev: uses: ./.github/workflows/call_release_ms.yml name: '[Dev] OnBoarding ms Release' - if: startsWith(github.ref_name, 'releases/') != true + if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }} secrets: inherit with: environment: dev @@ -27,7 +35,7 @@ jobs: release_uat: uses: ./.github/workflows/call_release_ms.yml name: '[UAT] OnBoarding ms Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }} secrets: inherit with: environment: uat @@ -36,7 +44,7 @@ jobs: release_prod: uses: ./.github/workflows/call_release_ms.yml name: '[Prod] OnBoarding ms Release' - if: startsWith(github.ref_name, 'releases/') + if: ${{ inputs.env == 'prod' }} secrets: inherit with: environment: prod