Skip to content

Commit

Permalink
Merge release-dev (#185)
Browse files Browse the repository at this point in the history
Merge release-dev
  • Loading branch information
manuraf authored Mar 20, 2024
2 parents caa9112 + 170404f commit 2b51200
Show file tree
Hide file tree
Showing 50 changed files with 1,400 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .devops/code-review-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
displayName: 'download settings.xml for Maven'
name: settingsxml
inputs:
secureFile: '$(SETTINGS_XML_RW_SECURE_FILE_NAME)'
secureFile: '$(SETTINGS_XML_RO_SECURE_FILE_NAME)'
retryCount: '2'
- task: Maven@4
inputs:
Expand Down
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
43 changes: 43 additions & 0 deletions .github/workflows/create_release_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
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
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 $NEW_BRANCH_NAME
- name: Trigger PNPG release ms UAT Release
run: |
gh workflow run release_ms_pnpg.yml \
--ref $NEW_BRANCH_NAME
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 ms-party-registry-proxy
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-ms-party-registry-proxy'

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 - ms-party-registry-proxy

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

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

jobs:

release_dev:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Dev] PartyRegistryProxy ms 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] PartyRegistryProxy ms 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] PartyRegistryProxy ms 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 ms-party-registry-proxy

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

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

jobs:

release_dev:
uses: pagopa/selfcare-commons/.github/workflows/call_release_docker.yml@main
name: '[Dev] PartyRegistryProxy ms 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] PartyRegistryProxy ms 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] PartyRegistryProxy ms Release'
if: ${{ inputs.env == 'prod' }}
secrets: inherit
with:
environment: prod
tf_environment: prod-pnpg
dir: 'infra/container_apps'
47 changes: 11 additions & 36 deletions .github/workflows/release_open_api.yml
Original file line number Diff line number Diff line change
@@ -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
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@v3
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 "[email protected]"
git config --global user.name "selfcare-github-bot"
git commit -m "Update Swagger documentation" || exit 0
git push origin ${{ github.ref_name}}
- 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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ build/
### VS Code ###
.vscode/
.DS_Store

**/.terraform/*
*.tfstate
*.tfstate.*
**/.tfsec/*
override.tf
override.tf.json
*_override.tf
*_override.tf.json
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.86.0
hooks:
- id: terraform_fmt
- id: terraform_docs
- id: terraform_validate
args:
- --args=-json
- --args=-no-color
1 change: 1 addition & 0 deletions .terraform-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.6.6
24 changes: 24 additions & 0 deletions Dockerfile.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM maven:3-eclipse-temurin-17 AS builder

COPY . .

RUN mvn clean package -DskipTests=true

FROM openjdk:17-jdk AS runtime

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'

WORKDIR /app

COPY --from=builder ./target/*.jar ./app.jar

ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.2.11/applicationinsights-agent-3.2.11.jar ./applicationinsights-agent.jar
RUN chmod 755 ./applicationinsights-agent.jar

RUN chown -R 1001:1001 /app
RUN chmod 755 /app
USER 1001

EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.jar"]
Loading

0 comments on commit 2b51200

Please sign in to comment.