Skip to content

Commit

Permalink
feat: added Terraform apply on Infrastructure (#3)
Browse files Browse the repository at this point in the history
* feat: added Terraform apply on Infrastructure

---------

Co-authored-by: pagopa-github-bot <github-bot@pagopa.it>
  • Loading branch information
andrea-deri and pagopa-github-bot authored Jul 15, 2024
1 parent 5999d16 commit 153600c
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/04h_deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,44 @@ jobs:
resource_group_name: ${{ vars.CONTAINER_APP_ENVIRONMENT_RESOURCE_GROUP_NAME }}
runner_name: ${{ needs.create_runner.outputs.runner_name }}
pat_token: ${{ secrets.BOT_TOKEN_GITHUB }}

update_openapi:
needs: [ deploy ]
runs-on: ubuntu-latest
name: Update OpenAPI
if: ${{ inputs.target == inputs.environment || inputs.target == 'all' }}
environment: ${{ inputs.environment }}
steps:
- name: Checkout
id: checkout
# from https://github.com/actions/checkout/commits/main
uses: actions/checkout@1f9a0c22da41e6ebfa534300ef656657ea2c6707
with:
persist-credentials: false

- name: Setup Terraform
# from https://github.com/hashicorp/setup-terraform/commits/main
uses: hashicorp/setup-terraform@8feba2b913ea459066180f9cb177f58a881cf146
with:
terraform_version: "1.3.6"

- name: Login
id: login
# from https://github.com/Azure/login/commits/master
uses: azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2
with:
client-id: ${{ secrets.CD_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.CD_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
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: pagopa-iuvgenerator
description: Microservice that permits to generate unique IUV codes for each creditor institution.
type: application
version: 0.11.0
appVersion: 0.2.9
version: 0.13.0
appVersion: 0.2.9-2-fix-infra-pipeline
dependencies:
- name: microservice-chart
version: 3.0.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:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-iuvgenerator
tag: "0.2.9"
tag: "0.2.9-2-fix-infra-pipeline"
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 @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-iuvgenerator
tag: "0.2.9"
tag: "0.2.9-2-fix-infra-pipeline"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
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-iuvgenerator
tag: "0.2.9"
tag: "0.2.9-2-fix-infra-pipeline"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A service that permits to generate unique IUV codes for each creditor institution.\n\n**STANDARD ERRORS:**\nNAME | CODE | DESCRIPTION\n- | - | -\n**IUVG-1000** | *GENERIC_ERROR* | Error while generating IUV. *...error description...*\n**IUVG-1001** | *VALIDATION_ERROR* | Error while validating IUV generation request. *...error description...*\n**IUVG-1101** | *GENERATION_MAX_RETRIES_REACHED* | Error while generating IUV. Reached the maximum number of internal automatic attempts [*...content...*] to generate a unique IUV for creditor institution [*...content...*]. Please, try again later.\n**IUVG-1102** | *GENERATION_AUXDIGIT_ALGORITHM_INVALID_PATTERN* | Error while generating IUV. The IUV code's section generated by timestamp in milliseconds is not correctly composited of 13 digits.\n",
"termsOfService": "https://www.pagopa.gov.it/",
"title": "IUV Generator",
"version": "0.2.9"
"version": "0.2.9-2-fix-infra-pipeline"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>iuvgenerator</artifactId>
<version>0.2.9</version>
<version>0.2.9-2-fix-infra-pipeline</version>
<name>pagoPA IUV Generator</name>
<description>A service that permits to generate unique IUV codes for each creditor institution.</description>

Expand Down

0 comments on commit 153600c

Please sign in to comment.