Skip to content

Commit

Permalink
Merge pull request #1 from pagopa/structure
Browse files Browse the repository at this point in the history
Structure
  • Loading branch information
aomegax authored Feb 21, 2023
2 parents 5bfa11b + 3e90710 commit f1fa04d
Show file tree
Hide file tree
Showing 83 changed files with 5,874 additions and 0 deletions.
1,712 changes: 1,712 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

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.
26 changes: 26 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# release.yml [M.m.p]
# ignore-for-release: does not release -> skip
# breaking-change: increase major version number (M.x.x) -> major
# enhancement: increase minor version number (x.m.x) -> minor
# bug: increase patch version number (x.x.p) -> patch
# buildNumber

changelog:
exclude:
labels:
- skip
authors:
- pagopa-github-bot
categories:
- title: Breaking Changes 🛠
labels:
- major
- title: Exciting New Features 🎉
labels:
- minor
- title: Bugfix 🩺
labels:
- patch
- title: Other Changes
labels:
- "*"
111 changes: 111 additions & 0 deletions .github/workflows/mvn_artifact.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created

name: Maven Package

# 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:
inputs:
semver:
required: true
type: choice
description: Select the new Semantic Version
options:
- major
- minor
- patch
- buildNumber

# permissions given to the current action
permissions:
packages: write
contents: write

jobs:

setup:
name: Semver setup
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.semver.outputs.semver }}
steps:
- name: Set semver
id: semver
# TODO set main after merge (commit hash)
uses: pagopa/github-actions-template/semver-setup@semver-def


build:
needs: setup

runs-on: ubuntu-latest

steps:
- name: Make Release
id: release
uses: pagopa/github-actions-template/maven-release@v1
with:
semver: ${{ needs.setup.outputs.semver }}
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}

- name: Make Package
id: package
uses: pagopa/github-actions-template/maven-release@semver-def
with:
semver: ${{ needs.setup.outputs.semver }}
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
branch: ${{ github.ref_name }}










## TODO enable the following
## needs: check_labels
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
#
# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# distribution: 'temurin'
# java-version: '11'
# cache: maven
#
# - name: Set up Maven
# uses: stCarolas/[email protected]
# with:
# maven-version: 3.8.2
#
# - name: Cache Maven packages
# uses: actions/cache@v1
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
#
# - name: Build with Maven
# run: mvn -B package --file pom.xml
#
# - name: Deploy to GitHub Package Registry
# run: |
# echo "<settings><servers><server><id>github</id><password>\${secrets.GITHUB_TOKEN}</password></server></servers></settings>" > ~/.m2/settings.xml
# REPO="gh::default::https://maven.pkg.github.com/${{github.repository}}"
# echo '$REPO'
# mvn deploy -DaltReleaseDeploymentRepository="${REPO}" -DaltSnapshotDeploymentRepository="${REPO}"


# TODO notify new version on slack channel
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
11
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# see https://help.github.com/en/articles/about-code-owners#example-of-a-codeowners-file

* @pagopa/api-config
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 PagoPA SpA

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# pagoPa API Config Starter

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=pagopa_pagopa-api-config&metric=alert_status)](https://sonarcloud.io/dashboard?id=pagopa_pagopa-api-config)

Starter module for projects related to _Nodo dei Pagamenti_ configuration.

## Technology Stack
- Java 11
- Spring
- Hibernate
- JPA

## Develop Locally 💻

### Prerequisites
- git
- maven
- jdk-11
- docker


## Contributors 👥
Made with ❤️ by PagoPa S.p.A.

### Mainteiners
See `CODEOWNERS` file
103 changes: 103 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.7</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>it.pagopa.pagopa.api-config-starter</groupId>
<artifactId>pagopa-api-config-starter</artifactId>
<version>0.0.1</version>
<description>Starter module for projects related to Nodo dei Pagamenti configuration.</description>

<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<java.version>11</java.version>
<repository.name>pagopa-api-config-starter</repository.name>
<repository.owner>pagopa</repository.owner>
</properties>

<dependencies>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

<!-- &lt;!&ndash; needed to add mvn artifact to local repository &ndash;&gt;-->
<!-- <plugin>-->
<!-- <artifactId>maven-deploy-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <altDeploymentRepository>-->
<!-- internal.repo::default::file://${project.build.directory}/mvn-artifact-->
<!-- </altDeploymentRepository>-->
<!-- </configuration>-->
<!-- </plugin>-->

<!-- needed to push the local mvn artifact to GitHub -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>

</build>

<!-- location build directory -->
<!-- <distributionManagement>-->
<!-- <repository>-->
<!-- <id>github</id>-->
<!-- <name>GitHub Apache Maven Packages</name>-->
<!-- <url>https://maven.pkg.github.com/pagopa/pagopa-api-config-starter</url>-->
<!-- </repository>-->
<!-- </distributionManagement>-->

</project>
14 changes: 14 additions & 0 deletions src/main/java/it/pagopa/pagopa/apiconfigstarter/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package it.pagopa.pagopa.apiconfigstarter;

import java.util.Locale;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class Application {

public static void main(String[] args) {
Locale.setDefault(Locale.ENGLISH);
SpringApplication.run(Application.class, args);
}
}
Loading

0 comments on commit f1fa04d

Please sign in to comment.