diff --git a/.devops/code-review-pipelines.yml b/.devops/code-review-pipelines.yml deleted file mode 100644 index c3387ba..0000000 --- a/.devops/code-review-pipelines.yml +++ /dev/null @@ -1,60 +0,0 @@ -# Maven -# Build your Java project and run tests with Apache Maven. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/java - -# Automatically triggered on PR -# https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#pr-trigger -trigger: none - -pool: - vmImage: 'ubuntu-18.04' - -variables: - MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository - MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)' - -steps: - - task: Cache@2 - inputs: - key: 'maven | "$(Agent.OS)" | pom.xml' - restoreKeys: | - maven | "$(Agent.OS)" - maven - path: $(MAVEN_CACHE_FOLDER) - displayName: Cache Maven local repo - - - task: SonarCloudPrepare@1 - displayName: 'Prepare SonarCloud analysis configuration' - inputs: - SonarCloud: '$(SONARCLOUD_SERVICE_CONN)' - organization: '$(SONARCLOUD_ORG)' - scannerMode: Other - extraProperties: | - sonar.projectKey=$(SONARCLOUD_PROJECT_KEY) - sonar.projectName=$(SONARCLOUD_PROJECT_NAME) - sonar.coverage.exclusions=**/config/*,**/*Mock*,**/model/**,**/entity/* - sonar.cpd.exclusions=**/model/**,**/entity/* - - - - task: Maven@3 - inputs: - mavenPomFile: 'pom.xml' - goals: 'clean verify' - publishJUnitResults: true - testResultsFiles: '**/surefire-reports/TEST-*.xml' - codeCoverageToolOption: 'JaCoCo' - javaHomeOption: 'JDKVersion' - jdkVersionOption: '1.11' - mavenVersionOption: 'Default' - mavenOptions: '-Xmx3072m $(MAVEN_OPTS)' - mavenAuthenticateFeed: false - effectivePomSkip: false - sonarQubeRunAnalysis: true - isJacocoCoverageReportXML: true - sqMavenPluginVersionChoice: 'latest' - - - task: SonarCloudPublish@1 - displayName: 'Publish SonarCloud results on build summary' - inputs: - pollingTimeoutSec: '300' diff --git a/.devops/deploy-pipelines.yml b/.devops/deploy-pipelines.yml deleted file mode 100644 index 33356a6..0000000 --- a/.devops/deploy-pipelines.yml +++ /dev/null @@ -1,223 +0,0 @@ -# Only manual triggers -trigger: none -pr: none - -pool: - vmImage: 'ubuntu-22.04' - -parameters: - - name: ENV - displayName: Target Environment - type: string - default: dev - values: - - dev - - uat - - prod - - name: SEMVER - displayName: "When packing a release, define the version bump to apply. Use only buildNumber or skip for manual deployment" - type: string - values: - - major - - minor - - patch - - buildNumber - - skip - default: skip - - name: "FORCE_REPLACE_DOCKER_IMAGE" - displayName: "Force the existing docker image to be replaced" - type: boolean - default: False - values: - - False - - True - - name: TEST - displayName: Run integration/smoke tests - type: boolean - default: true - -variables: - imageRepository: '$(IMAGE_REPOSITORY_NAME)' - nameSpace: '$(K8S_NAMESPACE)' - - ${{ if eq(parameters['ENV'], 'dev') }}: - dockerRegistryServiceConnection: $(DEV_CONTAINER_REGISTRY_SERVICE_CONN) - dockerRegistryFqdn: $(DEV_CONTAINER_NAMESPACE) - kubernetesServiceConnection: '$(DEV_KUBERNETES_SERVICE_CONN)' - poolImage: 'pagopa-dev-linux' - appInsightsServiceConn: "$(TF_APPINSIGHTS_SERVICE_CONN_DEV)" - appInsightsResourceId: "$(TF_APPINSIGHTS_RESOURCE_ID_DEV)" - ${{ if eq(parameters['ENV'], 'uat') }}: - dockerRegistryServiceConnection: $(UAT_CONTAINER_REGISTRY_SERVICE_CONN) - dockerRegistryFqdn: $(UAT_CONTAINER_NAMESPACE) - kubernetesServiceConnection: '$(UAT_KUBERNETES_SERVICE_CONN)' - poolImage: 'pagopa-uat-linux' - appInsightsServiceConn: "$(TF_APPINSIGHTS_SERVICE_CONN_UAT)" - appInsightsResourceId: "$(TF_APPINSIGHTS_RESOURCE_ID_UAT)" - ${{ if eq(parameters['ENV'], 'prod') }}: - dockerRegistryServiceConnection: $(PROD_CONTAINER_REGISTRY_SERVICE_CONN) - dockerRegistryFqdn: $(PROD_CONTAINER_NAMESPACE) - kubernetesServiceConnection: '$(PROD_KUBERNETES_SERVICE_CONN)' - poolImage: 'pagopa-prod-linux' - appInsightsServiceConn: "$(TF_APPINSIGHTS_SERVICE_CONN_PROD)" - appInsightsResourceId: "$(TF_APPINSIGHTS_RESOURCE_ID_PROD)" - - ${{ if eq(variables['Build.SourceBranchName'], 'merge') }}: - sourceBranch: "main" # force to main branch - ${{ if ne(variables['Build.SourceBranchName'], 'merge') }}: - sourceBranch: ${{ variables['Build.SourceBranchName'] }} - - - -resources: - repositories: - - repository: pagopaCommons - type: github - name: pagopa/azure-pipeline-templates - ref: refs/tags/v2.10.1 - endpoint: 'io-azure-devops-github-ro' - -stages: - - # Create a release on GitHub - - stage: Release - jobs: - - job: make_release - steps: - - checkout: self - clean: true - persistCredentials: true - - - ${{ if ne(parameters.SEMVER, 'skip') }}: - - template: templates/maven-github-release/template.yaml@pagopaCommons - parameters: - release_branch: $(sourceBranch) - gitEmail: $(GIT_EMAIL) - gitUsername: $(GIT_USERNAME) - gitHubConnection: $(GITHUB_CONNECTION) - ${{ if ne(parameters.SEMVER, 'skip') }}: - semver: '${{ parameters.SEMVER }}' - ${{ if eq(parameters.SEMVER, 'skip') }}: - semver: 'buildNumber' # this case is impossible due to main condition, but it is necessary to work property - - - template: templates/maven-github-current-version/template.yaml@pagopaCommons - - # Build and Push Docker Image - - stage: Build - dependsOn: Release - variables: - current_version: $[ stageDependencies.Release.make_release.outputs['current_version.value'] ] - jobs: - - job: "build" - steps: - - checkout: self - persistCredentials: true - - - script: | - git checkout $(sourceBranch) - displayName: Checkout and update branch - - - template: templates/docker-release/template.yaml@pagopaCommons - parameters: - CONTAINER_REGISTRY_SERVICE_CONN: $(dockerRegistryServiceConnection) - CONTAINER_REGISTRY_FQDN: $(dockerRegistryFqdn) - DOCKER_IMAGE_NAME: $(imageRepository) - DOCKER_IMAGE_TAG: $(current_version) - FORCE_REPLACE_DOCKER_IMAGE: ${{ parameters.FORCE_REPLACE_DOCKER_IMAGE }} - - # # Testing the docker image - # - stage: Smoke_Test - # dependsOn: - # - Build - # condition: and(succeeded(), eq('${{ parameters.TEST }}', 'true')) - # jobs: - # - job: smoke_tests - # steps: - # - checkout: self - # persistCredentials: true - # - # - script: | - # git checkout $(sourceBranch) - # displayName: Checkout and update branch - # - # - task: Docker@2 - # displayName: "Docker login" - # inputs: - # containerRegistry: "$(dockerRegistryServiceConnection)" - # command: "login" - # - # - task: Bash@3 - # displayName: 'Run Smoke Tests' - # inputs: - # targetType: 'inline' - # script: | - # cd ./integration-test - # sh run_integration_test.sh - # env: - # containerRegistry: $(dockerRegistryFqdn) - - # Deploy on K8s with Helm - - stage: Deploy - # condition: not(failed('Smoke_Test')) - dependsOn: - - Release - - Build - # - Smoke_Test - variables: - deploy_version: $[ stageDependencies.Release.make_release.outputs['current_version.value'] ] - jobs: - - deployment: "deploy" - pool: - name: $(poolImage) - environment: ${{ parameters['ENV'] }} - strategy: - runOnce: - deploy: - steps: - - checkout: self - persistCredentials: true - - - script: | - git checkout $(sourceBranch) - displayName: Checkout and update branch - - - template: templates/helm-microservice-chart-setup/template.yaml@pagopaCommons - parameters: - DEPLOY_VERSION: $(deploy_version) - - - template: templates/helm-microservice-chart-deploy/template.yaml@pagopaCommons - parameters: - DO_DEPLOY: true - ENV: ${{ parameters['ENV'] }} - KUBERNETES_SERVICE_CONN: ${{ variables.kubernetesServiceConnection }} - NAMESPACE: $(nameSpace) - APP_NAME: $(imageRepository) - VALUE_FILE: "helm/values-${{ parameters['ENV'] }}.yaml" - DEPLOY_VERSION: $(deploy_version) - APPINSIGHTS_SERVICE_CONN: ${{ variables.appInsightsServiceConn }} - APPINSIGHTS_RESOURCE_ID: ${{ variables.appInsightsResourceId }} - - - # Run Tests -# - stage: Integration_Test -# dependsOn: -# - Deploy -# condition: and(succeeded(), eq('${{ parameters.TEST }}', 'true')) -# jobs: -# - job: integration_tests -# steps: -# - checkout: self -# persistCredentials: true -# -# - script: | -# git checkout $(sourceBranch) -# displayName: Checkout and update branch -# -# - task: Bash@3 -# displayName: 'Run Integration Tests' -# inputs: -# targetType: 'inline' -# script: | -# cd ./integration-test/src -# yarn install -# yarn test:${{ parameters.ENV }} diff --git a/.github/workflows/deploy_with_github_runner.yml b/.github/workflows/deploy_with_github_runner.yml index 8e8e564..6e20abd 100644 --- a/.github/workflows/deploy_with_github_runner.yml +++ b/.github/workflows/deploy_with_github_runner.yml @@ -41,7 +41,6 @@ jobs: container_app_environment_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_NAME }} resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }} # RG of the runner pat_token: ${{ secrets.BOT_TOKEN_GITHUB }} - self_hosted_runner_image_tag: "v1.4.1" deploy: needs: [ create_runner ] diff --git a/helm/Chart.lock b/helm/Chart.lock index 6761769..33bd198 100644 --- a/helm/Chart.lock +++ b/helm/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: microservice-chart repository: https://pagopa.github.io/aks-microservice-chart-blueprint - version: 1.21.0 -digest: sha256:e3deccb7ac0b5d85af0c726f28316ebe7a3795cbf54522330c33474b0bae309a -generated: "2022-10-07T11:12:09.286079+02:00" + version: 2.3.1 +digest: sha256:92b42c64847373faa6bf054181be2d7ee61e8b6b6d6a5552bf1479691aa95df3 +generated: "2023-09-13T16:06:30.289747+02:00" diff --git a/helm/Chart.yaml b/helm/Chart.yaml index dc63942..5bd0e1f 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 name: pagopa-spontaneous-payments description: Microservice that handles spontaneous payments for pagoPA type: application -version: 0.2.0 -appVersion: 0.1.2 +version: 0.4.0 +appVersion: 0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows dependencies: - name: microservice-chart - version: 1.21.0 + version: 2.3.1 repository: "https://pagopa.github.io/aks-microservice-chart-blueprint" diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 0ac5896..87575f2 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -3,8 +3,8 @@ microservice-chart: nameOverride: "" fullnameOverride: "" image: - repository: pagopadcommonacr.azurecr.io/pagopaspontaneouspayments - tag: "0.1.2" #improve + repository: ghcr.io/pagopa/pagopa-spontaneous-payments + tag: "0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows" #improve pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index c6a1288..a5a6279 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -3,8 +3,8 @@ microservice-chart: nameOverride: "" fullnameOverride: "" image: - repository: pagopapcommonacr.azurecr.io/pagopaspontaneouspayments - tag: "0.1.2" #improve + repository: ghcr.io/pagopa/pagopa-spontaneous-payments + tag: "0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows" #improve pullPolicy: Always livenessProbe: httpGet: diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index df73b42..b4b8d07 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -3,8 +3,8 @@ microservice-chart: nameOverride: "" fullnameOverride: "" image: - repository: pagopaucommonacr.azurecr.io/pagopaspontaneouspayments - tag: "0.1.2" #improve + repository: ghcr.io/pagopa/pagopa-spontaneous-payments + tag: "0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows" #improve pullPolicy: Always livenessProbe: httpGet: diff --git a/infra/04_apim_api.tf b/infra/04_apim_api.tf index b24ae4d..24a6cbe 100644 --- a/infra/04_apim_api.tf +++ b/infra/04_apim_api.tf @@ -1,9 +1,9 @@ locals { - repo_name = "TODO" # TODO add the name of the repository + repo_name = "pagopa-spontaneous-payments" - display_name = "TODO" # TODO - description = "TODO" # TODO - path = "TODO" # TODO add your base path + display_name = "pagopa-spontaneous-payments" + description = "App for handling the spontaneous payments" + path = "gps/spontaneous-payments-service/v1" host = "api.${var.apim_dns_zone_prefix}.${var.external_domain}" hostname = var.hostname diff --git a/infra/99_locals.tf b/infra/99_locals.tf index 5ed42d0..8ec469e 100644 --- a/infra/99_locals.tf +++ b/infra/99_locals.tf @@ -4,7 +4,7 @@ locals { apim = { name = "${local.product}-apim" rg = "${local.product}-api-rg" - product_id = "TODO" # TODO product id to import from pagopa-infra + product_id = "spontaneouspayments" } } diff --git a/infra/env/weu-dev/backend.tfvars b/infra/env/weu-dev/backend.tfvars index 619395b..2cf5c9b 100644 --- a/infra/env/weu-dev/backend.tfvars +++ b/infra/env/weu-dev/backend.tfvars @@ -1,4 +1,4 @@ resource_group_name = "io-infra-rg" storage_account_name = "pagopainfraterraformdev" container_name = "azurermstate" -key = ".infra.tfstate" # TODO +key = "pagopa-spontaneous-payments.infra.tfstate" diff --git a/infra/env/weu-dev/terraform.tfvars b/infra/env/weu-dev/terraform.tfvars index 63a0705..fb6ab3b 100644 --- a/infra/env/weu-dev/terraform.tfvars +++ b/infra/env/weu-dev/terraform.tfvars @@ -6,10 +6,10 @@ tags = { CreatedBy = "Terraform" Environment = "Dev" Owner = "pagoPA" - Source = "https://github.com/pagopa/your-repository" # TODO + Source = "https://github.com/pagopa/pagopa-spontaneous-payments" CostCenter = "TS310 - PAGAMENTI & SERVIZI" } apim_dns_zone_prefix = "dev.platform" external_domain = "pagopa.it" -hostname = "weudev..internal.dev.platform.pagopa.it" # TODO +hostname = "weudev.gps.internal.dev.platform.pagopa.it" diff --git a/infra/env/weu-prod/backend.tfvars b/infra/env/weu-prod/backend.tfvars index dac1727..e69e4c0 100644 --- a/infra/env/weu-prod/backend.tfvars +++ b/infra/env/weu-prod/backend.tfvars @@ -1,4 +1,4 @@ resource_group_name = "io-infra-rg" storage_account_name = "pagopainfraterraformprod" container_name = "azurermstate" -key = ".infra.tfstate" # TODO +key = "pagopa-spontaneous-payments.infra.tfstate" diff --git a/infra/env/weu-prod/terraform.tfvars b/infra/env/weu-prod/terraform.tfvars index 77f85af..a1321c9 100644 --- a/infra/env/weu-prod/terraform.tfvars +++ b/infra/env/weu-prod/terraform.tfvars @@ -6,10 +6,10 @@ tags = { CreatedBy = "Terraform" Environment = "Prod" Owner = "pagoPA" - Source = "https://github.com/pagopa/your-repository" # TODO + Source = "https://github.com/pagopa/pagopa-spontaneous-payments" CostCenter = "TS310 - PAGAMENTI & SERVIZI" } apim_dns_zone_prefix = "platform" external_domain = "pagopa.it" -hostname = "weuprod..internal.platform.pagopa.it" # TODO +hostname = "weuprod.gps.internal.platform.pagopa.it" diff --git a/infra/env/weu-uat/backend.tfvars b/infra/env/weu-uat/backend.tfvars index 6f406b1..2a771f3 100644 --- a/infra/env/weu-uat/backend.tfvars +++ b/infra/env/weu-uat/backend.tfvars @@ -1,4 +1,4 @@ resource_group_name = "io-infra-rg" storage_account_name = "pagopainfraterraformuat" container_name = "azurermstate" -key = ".infra.tfstate" # TODO +key = "pagopa-spontaneous-payments.infra.tfstate" diff --git a/infra/env/weu-uat/terraform.tfvars b/infra/env/weu-uat/terraform.tfvars index e8160f1..1a5771c 100644 --- a/infra/env/weu-uat/terraform.tfvars +++ b/infra/env/weu-uat/terraform.tfvars @@ -6,10 +6,10 @@ tags = { CreatedBy = "Terraform" Environment = "Uat" Owner = "pagoPA" - Source = "https://github.com/pagopa/your-repository" # TODO + Source = "https://github.com/pagopa/pagopa-spontaneous-payments" CostCenter = "TS310 - PAGAMENTI & SERVIZI" } apim_dns_zone_prefix = "uat.platform" external_domain = "pagopa.it" -hostname = "weuuat..internal.uat.platform.pagopa.it" # TODO +hostname = "weuuat.gps.internal.uat.platform.pagopa.it" diff --git a/openapi/openapi.json b/openapi/openapi.json index 566428a..3b0d02e 100644 --- a/openapi/openapi.json +++ b/openapi/openapi.json @@ -4,7 +4,7 @@ "title": "PagoPA API Spontaneous Payment", "description": "Progetto Gestione Pagamenti Spontanei", "termsOfService": "https://www.pagopa.gov.it/", - "version": "0.1.2" + "version": "0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows" }, "servers": [ { diff --git a/pom.xml b/pom.xml index c895586..dc00906 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ it.gov.pagopa spontaneouspayment - 0.1.2 + 0.1.1-3-PAGOPA-1211-migrazione-gha-pagopa-spontaneous-payments-testing-flows Gestione Pagamenti Spontanei Progetto Gestione Pagamenti Spontanei