diff --git a/.github/workflows/create_release_branch.yml b/.github/workflows/create_release_branch.yml new file mode 100644 index 00000000..40f2b7e5 --- /dev/null +++ b/.github/workflows/create_release_branch.yml @@ -0,0 +1,44 @@ +name: Create Release branch + +on: + workflow_dispatch: + inputs: + version-bump: + required: false + type: choice + options: + - major + - minor + - patch + default: patch + description: 'Major, Minor, or Patch version bump' + +jobs: + create_branch: + name: 'Create Release Branch' + runs-on: ubuntu-20.04 + permissions: + contents: write + actions: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + + - name: Create Release Branch + id: create_branch + uses: pagopa/selfcare-commons/github-actions-template/create-release@main + with: + version_bump: ${{ inputs.version-bump }} + github_path_token: ${{ secrets.GH_PAT_VARIABLES }} + + - name: Trigger release ms UAT Release + run: | + gh workflow run release_ms.yml \ + --ref ${{ steps.create_branch.outputs.new_branch_name }} + + - name: Trigger PNPG release ms UAT Release + run: | + gh workflow run release_ms_pnpg.yml \ + --ref ${{ steps.create_branch.outputs.new_branch_name }} + diff --git a/.github/workflows/release_ms.yml b/.github/workflows/release_ms.yml index f5ea49a2..10a2d9c3 100644 --- a/.github/workflows/release_ms.yml +++ b/.github/workflows/release_ms.yml @@ -54,4 +54,14 @@ jobs: with: environment: prod tf_environment: prod - dir: 'infra/container_apps' \ No newline at end of file + dir: 'infra/container_apps' + + promote_release: + name: 'Promote prerelase release' + runs-on: ubuntu-20.04 + needs: [release_prod] + steps: + - uses: pagopa/selfcare-commons/github-actions-template/promote-release@main + with: + github_path_token: ${{ secrets.GH_PAT_VARIABLES }} + release_version: ${{ vars.CURRENT_UAT_VERSION }} \ No newline at end of file diff --git a/.github/workflows/release_open_api.yml b/.github/workflows/release_open_api.yml index 6ba3d95a..ea2f1cf1 100644 --- a/.github/workflows/release_open_api.yml +++ b/.github/workflows/release_open_api.yml @@ -1,46 +1,21 @@ -name: Swagger Update +name: Swagger Detect Conflict and Update on: pull_request: branches: - release-dev - types: [ opened, synchronize, reopened ] - workflow_dispatch: #allow to run github action manually + types: [ opened, synchronize, reopened ] + permissions: contents: write + jobs: - build: - runs-on: ubuntu-latest + swagger_conflict_update: + runs-on: ubuntu-20.04 permissions: write-all - #if: github.event.pull_request.merged == true + name: Swagger Detect Conflict and Update steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - name: Set up JDK 17 - uses: actions/setup-java@f69f00b5e5324696b07f6b1c92f0470a6df00780 - with: - java-version: '17' - distribution: 'temurin' - cache: maven - - name: Check out HEAD revision - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - ref: ${{ github.head_ref }} - path: head - - name: Check out BASE revision - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - ref: release-dev - path: base - - name: Build with Maven - run: mvn test -Dtest=SwaggerConfigTest#swaggerSpringPlugin -DfailIfNoTests=false - - name: Run OpenAPI Diff (from HEAD revision) - uses: mvegter/openapi-diff-action@72cde50f8d3a75f770f08e23b815d5ebe69ff757 - with: - head-spec: head/app/src/main/resources/swagger/api-docs.json - base-spec: base/app/src/main/resources/swagger/api-docs.json - - name: Commit api-docs - run: | - git ls-files ./app** | grep 'api-docs*' | xargs git add - git config --global user.email "selfcare-github@pagopa.it" - git config --global user.name "selfcare-github-bot" - git commit -m "Update Swagger documentation" || exit 0 - git push origin ${{ github.ref_name}} \ No newline at end of file + - id: swagger-conflict-update + uses: pagopa/selfcare-commons/github-actions-template/swagger-detect-conflict-spring@main + with: + path_openapi_docs: app/src/main/resources/swagger/api-docs.json + branch_ref: release-dev \ No newline at end of file diff --git a/helm/pnpg/values-dev.yaml b/helm/pnpg/values-dev.yaml index 5e3e6a3d..e7336c49 100644 --- a/helm/pnpg/values-dev.yaml +++ b/helm/pnpg/values-dev.yaml @@ -1,3 +1,5 @@ +replicaCount: 0 + image: repository: selcdcommonacr.azurecr.io/selfcareexternalapibackend @@ -16,8 +18,8 @@ ingress: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/pnpg/values-uat.yaml b/helm/pnpg/values-uat.yaml index 69f260ce..92d9c9d4 100644 --- a/helm/pnpg/values-uat.yaml +++ b/helm/pnpg/values-uat.yaml @@ -1,3 +1,5 @@ +replicaCount: 0 + image: repository: selcucommonacr.azurecr.io/selfcareexternalapibackend tag: 0.0.1-SNAPSHOT @@ -17,8 +19,8 @@ ingress: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index f05f293b..0e76586b 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 0 image: repository: selcdacr.azurecr.io/selfcareexternalapibackend @@ -26,8 +26,8 @@ resources: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index ff4c7a36..e1c8588e 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -1,4 +1,4 @@ -replicaCount: 2 +replicaCount: 0 image: repository: selcuacr.azurecr.io/selfcareexternalapibackend @@ -27,8 +27,8 @@ resources: autoscaling: enabled: false - minReplicas: 1 - maxReplicas: 100 + minReplicas: 0 + maxReplicas: 0 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 diff --git a/infra/container_apps/env/dev-pnpg/terraform.tfvars b/infra/container_apps/env/dev-pnpg/terraform.tfvars index 1576a560..182f7abd 100644 --- a/infra/container_apps/env/dev-pnpg/terraform.tfvars +++ b/infra/container_apps/env/dev-pnpg/terraform.tfvars @@ -71,6 +71,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.uat.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-d-pnpg-ms-core-ca.whiteglacier-211c4885.westeurope.azurecontainerapps.io" } ] diff --git a/infra/container_apps/env/dev/terraform.tfvars b/infra/container_apps/env/dev/terraform.tfvars index 2e73b690..af4c6e4f 100644 --- a/infra/container_apps/env/dev/terraform.tfvars +++ b/infra/container_apps/env/dev/terraform.tfvars @@ -69,6 +69,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.uat.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-d-ms-core-ca.gentleflower-c63e62fe.westeurope.azurecontainerapps.io" } ] diff --git a/infra/container_apps/env/prod-pnpg/terraform.tfvars b/infra/container_apps/env/prod-pnpg/terraform.tfvars index e3e94e16..4fe0edec 100644 --- a/infra/container_apps/env/prod-pnpg/terraform.tfvars +++ b/infra/container_apps/env/prod-pnpg/terraform.tfvars @@ -84,6 +84,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-p-pnpg-ms-core-ca.salmonpond-60269923.westeurope.azurecontainerapps.io" } ] diff --git a/infra/container_apps/env/prod/terraform.tfvars b/infra/container_apps/env/prod/terraform.tfvars index 04a42af3..a801b2f9 100644 --- a/infra/container_apps/env/prod/terraform.tfvars +++ b/infra/container_apps/env/prod/terraform.tfvars @@ -83,6 +83,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-p-ms-core-ca.bluedune-cc0f8752.westeurope.azurecontainerapps.io" } ] diff --git a/infra/container_apps/env/uat-pnpg/terraform.tfvars b/infra/container_apps/env/uat-pnpg/terraform.tfvars index 358fb13d..26e19e99 100644 --- a/infra/container_apps/env/uat-pnpg/terraform.tfvars +++ b/infra/container_apps/env/uat-pnpg/terraform.tfvars @@ -71,6 +71,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.uat.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-u-pnpg-ms-core-ca.redground-be752d1f.westeurope.azurecontainerapps.io" } ] diff --git a/infra/container_apps/env/uat/terraform.tfvars b/infra/container_apps/env/uat/terraform.tfvars index 6fb30b03..b86f505f 100644 --- a/infra/container_apps/env/uat/terraform.tfvars +++ b/infra/container_apps/env/uat/terraform.tfvars @@ -70,6 +70,10 @@ app_settings = [ { name = "USERVICE_USER_REGISTRY_URL" value = "https://api.uat.pdv.pagopa.it/user-registry/v1" + }, + { + name = "USERVICE_PARTY_MANAGEMENT_URL" + value = "https://selc-u-ms-core-ca.calmsky-143987c1.westeurope.azurecontainerapps.io" } ]