Skip to content

Commit

Permalink
Merge branch 'bugfix/SELC-4456' of https://github.com/pagopa/selfcare…
Browse files Browse the repository at this point in the history
…-dashboard-backend into bugfix/SELC-4456
  • Loading branch information
pierpaolo.didato@emeal.nttdata.com authored and pierpaolo.didato@emeal.nttdata.com committed Mar 18, 2024
2 parents 15ebe8c + 7542f76 commit 52cf9c6
Show file tree
Hide file tree
Showing 56 changed files with 2,178 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**/.dockerignore
**/.git
**/bin
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
54 changes: 54 additions & 0 deletions .github/workflows/opex_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Opex Dashboard

on:
push:
branches:
- main
paths:
- 'api-spec/api-pagopa-proxy.yaml'
- '.github/workflows/opex_api.yml'
- '.opex/api-selfcare-dashboard/**'
workflow_dispatch:

env:
TEMPLATE_DIR: azure-dashboard
API_NAME: api-selfcare-dashboard
DOCKER_IMAGE_TAG: sha256:04d8ead53c772d23b094c2a395292dc159e6f2905e1b13b5f828f31eac6eb27f

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-22.04
environment: 'prod-cd'

steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: false
fetch-depth: 0

- name: Read terraform version
id: read-version
shell: bash
run: |
echo "TERRAFORM_VERSION=`cat .terraform-version`" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@69c00852f1304c321337f45a105731218c2d5544
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

- uses: pagopa/opex-dashboard-azure-action@3ad80a5e4a2d5a8f342615637072f21b687320ce
with:
environment: prod
api-name: ${{ env.API_NAME }}
config: .opex/${{ env.API_NAME }}/env/prod/config.yaml
client-id: ${{ secrets.ARM_CLIENT_ID }}
tenant-id: ${{ vars.ARM_TENANT_ID }}
subscription-id: ${{ vars.ARM_SUBSCRIPTION_ID }}
docker-version: ${{ env.DOCKER_IMAGE_TAG }}
54 changes: 54 additions & 0 deletions .github/workflows/opex_api_pnpg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Opex Dashboard PNPG

on:
push:
branches:
- main
paths:
- 'api-spec/api-pagopa-proxy.yaml'
- '.github/workflows/opex_api.yml'
- '.opex/api-selfcare-dashboard-pnpg/**'
workflow_dispatch:

env:
TEMPLATE_DIR: azure-dashboard
API_NAME: api-selfcare-dashboard-pnpg
DOCKER_IMAGE_TAG: sha256:04d8ead53c772d23b094c2a395292dc159e6f2905e1b13b5f828f31eac6eb27f

permissions:
id-token: write
contents: read

jobs:
build:
runs-on: ubuntu-22.04
environment: 'prod-cd'

steps:
- name: Checkout
id: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
persist-credentials: false
fetch-depth: 0

- name: Read terraform version
id: read-version
shell: bash
run: |
echo "TERRAFORM_VERSION=`cat .terraform-version`" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@69c00852f1304c321337f45a105731218c2d5544
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}

- uses: pagopa/opex-dashboard-azure-action@3ad80a5e4a2d5a8f342615637072f21b687320ce
with:
environment: prod
api-name: ${{ env.API_NAME }}
config: .opex/${{ env.API_NAME }}/env/prod/config.yaml
client-id: ${{ secrets.ARM_CLIENT_ID }}
tenant-id: ${{ vars.ARM_TENANT_ID }}
subscription-id: ${{ vars.ARM_SUBSCRIPTION_ID }}
docker-version: ${{ env.DOCKER_IMAGE_TAG }}
37 changes: 37 additions & 0 deletions .github/workflows/pr_ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Code Review dashboard-backend
on:
workflow_dispatch:

pull_request:
types:
- synchronize
- reopened
- ready_for_review
paths:
- '.github/workflows/pr_ms.yml'
- '.github/workflows/release_ms.yml'
- '.github/workflows/release_ms_pnpg.yml'
- '!.devops/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

code_review:
uses: pagopa/selfcare-commons/.github/workflows/call_code_review_spring.yml@main
name: 'Code Review'
secrets: inherit
if: github.base_ref == 'main' && github.event_name == 'pull_request'
with:
pr_number: ${{ github.event.pull_request.number }}
source_branch: ${{ github.head_ref }}
target_branch: ${{ github.base_ref }}
sonar_key: 'pagopa_selfcare-dashboard-backend'

docker_build:
uses: pagopa/selfcare-commons/.github/workflows/call_code_review_docker.yml@main
name: 'Docker'
57 changes: 57 additions & 0 deletions .github/workflows/release_ms.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release - dashboard-backend

on:
workflow_dispatch:
inputs:
env:
type: choice
description: Environment
options:
- dev
- uat
- prod

push:
branches:
- main
- releases/*
paths:
- '!.devops/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

release_dev:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Dev] DashboardBackend Release'
if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }}
secrets: inherit
with:
environment: dev
tf_environment: dev
dir: 'infra/container_apps'

release_uat:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[UAT] DashboardBackend Release'
if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }}
secrets: inherit
with:
environment: uat
tf_environment: uat
dir: 'infra/container_apps'

release_prod:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Prod] DashboardBackend Release'
if: ${{ inputs.env == 'prod' }}
secrets: inherit
with:
environment: prod
tf_environment: prod
dir: 'infra/container_apps'
57 changes: 57 additions & 0 deletions .github/workflows/release_ms_pnpg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release - PNPG dashboard-backend

on:
workflow_dispatch:
inputs:
env:
type: choice
description: Environment
options:
- dev
- uat
- prod

push:
branches:
- main
- releases/*
paths:
- '!.devops/**'
- '!helm/**'
- '!**.md'
- '!**ignore'
- '!infra/repository/**'
- '!.terraform-version'
- '!CODEOWNERS'

jobs:

release_dev:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Dev] DashboardBackend Release'
if: ${{ (startsWith(github.ref_name, 'releases/') != true && inputs.env == null) || inputs.env == 'dev' }}
secrets: inherit
with:
environment: dev
tf_environment: dev-pnpg
dir: 'infra/container_apps'

release_uat:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[UAT] DashboardBackend Release'
if: ${{ (startsWith(github.ref_name, 'releases/') == true && inputs.env == null) || inputs.env == 'uat' }}
secrets: inherit
with:
environment: uat
tf_environment: uat-pnpg
dir: 'infra/container_apps'

release_prod:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Prod] DashboardBackend Release'
if: ${{ inputs.env == 'prod' }}
secrets: inherit
with:
environment: prod
tf_environment: prod-pnpg
dir: 'infra/container_apps'
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ build/

### VS Code ###
.vscode/
.DS_Store

**/.terraform/*
*.tfstate
*.tfstate.*
**/.tfsec/*
override.tf
override.tf.json
*_override.tf
*_override.tf.json
1 change: 1 addition & 0 deletions .opex/api-selfcare-dashboard-pnpg/env/prod/backend.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subscription=PROD-SelfCare
4 changes: 4 additions & 0 deletions .opex/api-selfcare-dashboard-pnpg/env/prod/backend.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource_group_name = "terraform-state-rg"
storage_account_name = "tfappprodselfcare"
container_name = "terraform-state"
key = "opex.b4f-dashboard-pnpg.tfstate"
Loading

0 comments on commit 52cf9c6

Please sign in to comment.