Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed May 31, 2022
1 parent a3c9ff4 commit 62694e4
Show file tree
Hide file tree
Showing 10 changed files with 253 additions and 9 deletions.
36 changes: 36 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!--- Please always add a PR description as if nobody knows anything about the context these changes come from. -->
<!--- Even if we are all from our internal team, we may not be on the same page. -->
<!--- Write this PR as you were contributing to a public OSS project, where nobody knows you and you have to earn their trust. -->
<!--- This will improve our projects in the long run! Thanks. -->

#### List of Changes

<!--- Describe your changes in detail -->

#### Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

#### How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, tests ran to see how -->
<!--- your change affects other areas of the code, etc. -->

#### Screenshots (if appropriate):

#### Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

#### Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
3 changes: 3 additions & 0 deletions .github/auto_assign.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
addAssignees: author

runOnDraft: true
18 changes: 18 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# release.yml

changelog:
exclude:
labels:
- ignore-for-release
authors:
- pagopa-github-bot
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: Exciting New Features 🎉
labels:
- enhancement
- title: Other Changes
labels:
- "*"
26 changes: 26 additions & 0 deletions .github/workflows/assignee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Auto Assign

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
pull_request_target:
branches:
- main
types: [ opened, reopened ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Assign Me
# You may pin to the exact commit or the version.
uses: kentaro-m/[email protected]
with:
configuration-path: '.github/auto_assign.yml'
35 changes: 35 additions & 0 deletions .github/workflows/check_metadata_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check PR

# Controls when the workflow will run
on:
pull_request_target:
branches:
- main
types: [ opened, labeled, unlabeled, reopened ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Check Labels
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

- name: Verify PR Labels
uses: jesusvasquez333/[email protected]
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
valid-labels: 'bug, enhancement, breaking-change, ignore-for-release'
pull-request-number: '${{ github.event.pull_request.number }}'

- name: Label Check
if: ${{ !contains(github.event.pull_request.labels.*.name, 'breaking-change') && !contains(github.event.pull_request.labels.*.name, 'enhancement') && !contains(github.event.pull_request.labels.*.name, 'bug') && !contains(github.event.pull_request.labels.*.name, 'ignore-for-release') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('Missing required labels')
59 changes: 59 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Auto Deploy

# Controls when the workflow will run
on:
pull_request:
branches:
- main
types: [ closed ]


# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
if: ${{ github.event.pull_request.merged }}
name: Call Azure Build Pipeline
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# default skip bump versioning
- name: Set as default skip bump versioning
run: |
echo "SEMVER=skip" >> $GITHUB_ENV
- name: Set major
run: |
echo "SEMVER=major" >> $GITHUB_ENV
if: ${{ contains(github.event.pull_request.labels.*.name, 'breaking-change') }}

- name: Set minor
run: |
echo "SEMVER=minor" >> $GITHUB_ENV
if: ${{ contains(github.event.pull_request.labels.*.name, 'enhancement') }}

- name: Set patch
run: |
echo "SEMVER=patch" >> $GITHUB_ENV
if: ${{ contains(github.event.pull_request.labels.*.name, 'bug') }}

- name: Set skip
run: |
echo "SEMVER=skip" >> $GITHUB_ENV
if: ${{ contains(github.event.pull_request.labels.*.name, 'ignore-for-release') }}

- name: Azure Pipelines Action - Jversion
uses: jacopocarlini/[email protected]
with:
azure-devops-project-url: https://dev.azure.com/pagopaspa/pagoPA-projects
# TODO: set name
azure-pipeline-name: 'pagopa-api-config.deploy'
azure-devops-token: ${{ secrets.AZURE_DEVOPS_TOKEN }}
azure-template-parameters: '{"ENV": "dev", "SEMVER": "${{env.SEMVER}}", "TEST": "true"}'
azure-pipeline-variables: '{"system.debug": "true"}'

29 changes: 29 additions & 0 deletions .github/workflows/sonar_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Sonar Analysis

# Controls when the workflow will run
on:
push:
branches:
- main

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
name: Call Azure Build Pipeline
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Azure Pipelines Action - Jversion
uses: jacopocarlini/[email protected]
with:
azure-devops-project-url: https://dev.azure.com/pagopaspa/pagoPA-projects
# TODO: set name
azure-pipeline-name: 'pagopa-api-config.code-review'
azure-devops-token: ${{ secrets.AZURE_DEVOPS_TOKEN }}
azure-pipeline-variables: '{"system.debug": "true"}'

42 changes: 42 additions & 0 deletions .github/workflows/update_infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Open a PR in Infra repository

on:
pull_request:
branches:
- main
types: [ closed ]
paths:
- 'openapi/openapi.json'


workflow_dispatch:

jobs:
pull-request:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

# prepare openapi template for infra repo
- run: |
mkdir -p "${GITHUB_WORKSPACE}/infra"
# TODO: set basepath
jq '."servers"[0]."url" |= "${host}/apiconfig/api/v1"' "${GITHUB_WORKSPACE}/openapi/openapi.json" > "${GITHUB_WORKSPACE}/infra/_openapi.json.tpl"

# open a PR on infra repo
- name: Create pull request
uses: jacopocarlini/action-pull-request-another-repo@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_folder: 'infra'
destination_repo: 'pagopa/pagopa-infra'
# TODO: set destination folder
destination_folder: 'src/api/apiconfig_api/v1'
destination_base_branch: 'main'
destination_head_branch: 'SpontaneousPayments-swagger-update'
user_email: '[email protected]'
user_name: 'pagopa-github-bot'
allow_force_push: 'true'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
target/**/*
.vscode
.vscode
/.idea/
11 changes: 3 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ version: '2'

services:
app:
image: 'microservice:latest'
cpus: 1.0
mem_limit: "3g"
image: 'spontaneous-payments:latest'
build:
context: .
container_name: app
ports:
- 9090:9090
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE=200MB
- JAVA_OPTS=-XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseStringDeduplication
- 8080:8080

0 comments on commit 62694e4

Please sign in to comment.