Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/03_code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
project_key: ${{env.PROJECT_KEY}}
coverage_exclusions: "**/config/*,**/*Mock*,**/model/**,**/entity/*"
coverage_exclusions: "**/config/*,**/*Mock*,**/model/**,**/entity/*,**/exception/*,**/util/*,Application"
cpd_exclusions: "**/model/**,**/entity/*"
java_version: 17

Expand Down
29 changes: 1 addition & 28 deletions .github/workflows/04_release_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
description: Select the Environment
options:
- dev
- uat
# - uat
# - prod
semver:
required: false
Expand All @@ -29,18 +29,6 @@ on:
- patch
- new_release
- breaking_change
use_oracle:
description: Install Oracle version
type: boolean
default: false
use_postgres:
description: Install PostgreSQL version
type: boolean
default: true
use_postgres_nexi:
description: Install PostgreSQL Nexi version
type: boolean
default: true
beta:
required: false
type: boolean
Expand All @@ -61,18 +49,6 @@ on:
required: true
type: string
default: skip
use_oracle:
required: true
type: boolean
default: false
use_postgres:
required: true
type: boolean
default: true
use_postgres_nexi:
required: true
type: boolean
default: true

permissions:
packages: write
Expand Down Expand Up @@ -140,9 +116,6 @@ jobs:
with:
environment: ${{ matrix.environment }}
target: ${{ needs.setup.outputs.environment }}
use_oracle: ${{ inputs.use_oracle }}
use_postgres: ${{ inputs.use_postgres }}
use_postgres_nexi: ${{ inputs.use_postgres_nexi }}
secrets: inherit

notify:
Expand Down
65 changes: 42 additions & 23 deletions .github/workflows/04h_deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@ on:
required: true
description: The environment target of the job
type: string
use_oracle:
required: true
description: Deploy Oracle version
type: boolean
use_postgres:
required: true
description: Deploy PoststgreSQL version
type: boolean
use_postgres_nexi:
required: true
description: Deploy PoststgreSQL Nexi version
type: boolean

env:
APP_NAME: apiconfig-testing-support


permissions:
id-token: write
contents: read
Expand All @@ -47,16 +34,8 @@ jobs:
id: helm_generation
shell: bash
run: |
HELM_ARGS="--debug --wait --timeout 15m0s --set microservice-chart.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set postgresql.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set postgresql-nexi.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set oracle.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}}"
if ${USE_POSTGRES}; then
HELM_ARGS="$HELM_ARGS --set postgresql.forceRedeploy=true --set postgresql.enabled=true"
fi
if ${USE_POSTGRES_NEXI}; then
HELM_ARGS="$HELM_ARGS --set postgresql-nexi.forceRedeploy=true --set postgresql-nexi.enabled=true"
fi
if ${USE_ORACLE}; then
HELM_ARGS="$HELM_ARGS --set oracle.forceRedeploy=true --set oracle.enabled=true"
fi
HELM_ARGS="--debug --wait --timeout 15m0s --set microservice-chart.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}} --set postgresql.azure.workloadIdentityClientId=${{vars.WORKLOAD_IDENTITY_ID}}"
HELM_ARGS="$HELM_ARGS --set postgresql.forceRedeploy=true --set postgresql.enabled=true"
echo "::set-output name=helm_args::$HELM_ARGS"
env:
USE_ORACLE: ${{ inputs.use_oracle }}
Expand All @@ -76,3 +55,43 @@ jobs:
resource_group: ${{ vars.CLUSTER_RESOURCE_GROUP }}
app_name: ${{ env.APP_NAME }}
helm_upgrade_options: ${{ steps.helm_generation.outputs.helm_args }}

update_openapi:
needs: [ deploy ]
runs-on: ubuntu-latest
name: Update OpenAPI
environment: ${{ inputs.environment }}
steps:
- name: Checkout
id: checkout
# from https://github.com/actions/checkout/commits/main
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b #v4.1.4
with:
persist-credentials: false

- name: Setup Terraform
# from https://github.com/hashicorp/setup-terraform/commits/main
uses: hashicorp/setup-terraform@8feba2b913ea459066180f9cb177f58a881cf146
with:
terraform_version: ${{ vars.TERRAFORM_VERSION }}

- name: Login
id: login
# from https://github.com/Azure/login/commits/master
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
with:
client-id: ${{ secrets.CLIENT_ID }}
tenant-id: ${{ secrets.TENANT_ID }}
subscription-id: ${{ secrets.SUBSCRIPTION_ID }}

- name: Terraform Apply
shell: bash
run: |
cd ./infra
export ARM_CLIENT_ID="${{ secrets.CLIENT_ID }}"
export ARM_SUBSCRIPTION_ID=$(az account show --query id --output tsv)
export ARM_TENANT_ID=$(az account show --query tenantId --output tsv)
export ARM_USE_OIDC=true
export ARM_ACCESS_KEY=$(az storage account keys list --resource-group io-infra-rg --account-name pagopainfraterraform${{inputs.environment}} --query '[0].value' -o tsv)
bash ./terraform.sh init weu-${{ inputs.environment }}
bash ./terraform.sh apply weu-${{ inputs.environment }} -auto-approve
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Api Documentation 📖

See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/<TODO-repo>/main/openapi/openapi.json)
See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubusercontent.com/pagopa/pagopa-api-config-testing-support/main/openapi/openapi.json)

---

Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: apiconfig-testing-support
description: Microservice that handles tests about Nodo dei Pagamenti
type: application
version: 0.24.0
appVersion: 0.0.3
version: 0.25.0
appVersion: 0.0.3-1-PAGOPA-2289-massive
dependencies:
- name: microservice-chart
version: 7.5.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart: &microservice-chart
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-api-config-testing-support
tag: "0.0.3"
tag: "0.0.3-1-PAGOPA-2289-massive"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@
# create: false
microservice-chart:
image:
tag: 0.0.3
tag: 0.0.3-1-PAGOPA-2289-massive
canaryDelivery:
create: false
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-api-config-testing-support
tag: "0.0.3"
tag: "0.0.3-1-PAGOPA-2289-massive"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
4 changes: 2 additions & 2 deletions infra/04_apim_api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module "api_v1_postgres" {
################

resource "azurerm_api_management_api_version_set" "api_version_set_oracle" {
count = local.count
count = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not remove them if count is 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure there will never be a need again :)
I will remove it after it is accepted in SIT env

name = "${var.prefix}-${var.env_short}-${local.project_name}-o"
resource_group_name = local.apim.rg
api_management_name = local.apim.name
Expand All @@ -77,7 +77,7 @@ resource "azurerm_api_management_api_version_set" "api_version_set_oracle" {
}

module "api_v1_oracle" {
count = local.count
count = 0
source = "git::https://github.com/pagopa/terraform-azurerm-v3.git//api_management_api?ref=v6.7.0"

name = "${var.prefix}-${var.env_short}-${local.project_name}-o"
Expand Down
Loading
Loading