Skip to content

Commit 0ab0208

Browse files
Bay Typical (WIP)
0 parents  commit 0ab0208

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3506
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-FileCopyrightText: 2023 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
*
6+
!target/*-runner
7+
!target/*-runner.jar
8+
!target/lib/*
9+
!target/quarkus-app/*

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SPDX-FileCopyrightText: 2023 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
#
6+
# https://help.github.com/articles/dealing-with-line-endings/
7+
#
8+
# These are explicitly windows files and should use crlf
9+
*.bat text eol=crlf
10+
*.cmd text eol=crlf
11+

.github/dependabot.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
version: 2
6+
7+
registries:
8+
maven-github:
9+
type: maven-repository
10+
url: https://maven.pkg.github.com/com-pas/*
11+
username: OWNER
12+
password: ${{ secrets.DB_GITHUB_PACKAGES }}
13+
14+
updates:
15+
# Maintain dependencies for GitHub Actions
16+
- package-ecosystem: "github-actions"
17+
directory: "/"
18+
schedule:
19+
interval: "daily"
20+
open-pull-requests-limit: 5
21+
22+
# Maintain dependencies for Maven
23+
- package-ecosystem: "maven"
24+
directory: "/"
25+
registries:
26+
- maven-github
27+
schedule:
28+
interval: "daily"
29+
open-pull-requests-limit: 5
30+
ignore:
31+
# Next two dependencies shouldn't be upgrade, because RestEasy isn't using newer version. (2.3.X)
32+
- dependency-name: jakarta.xml.bind:jakarta.xml.bind-api
33+
versions: [ "[3.0,)" ]
34+
- dependency-name: com.sun.xml.bind:jaxb-impl
35+
versions: [ "[3.0,)" ]
36+
37+
- package-ecosystem: "docker"
38+
directory: "/app/src/main/docker/"
39+
schedule:
40+
interval: "daily"
41+
open-pull-requests-limit: 5

.github/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
changelog:
6+
exclude:
7+
labels:
8+
- wontfix
9+
- duplicate
10+
- invalid
11+
categories:
12+
- title: New Features
13+
labels:
14+
- enhancement
15+
- title: Bugfixes
16+
labels:
17+
- bug
18+
- title: Tooling changes
19+
labels:
20+
- tooling
21+
- title: Dependency updates
22+
labels:
23+
- dependencies
24+
- title: Other Changes
25+
labels:
26+
- "*"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Add issues and pull request to project boards
6+
7+
on: [ issues, pull_request, pull_request_target ]
8+
9+
jobs:
10+
github-actions-automate-projects:
11+
runs-on: ubuntu-latest
12+
13+
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
14+
steps:
15+
- name: add-new-issues-to-organization-based-project-column
16+
if: github.event_name == 'issues' && github.event.action == 'opened'
17+
uses: alex-page/github-project-automation-plus@v0.8.3
18+
with:
19+
project: CoMPAS Issues Overview Board
20+
column: To do
21+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
22+
- name: add-new-pull-request-to-organization-based-project-column
23+
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
24+
uses: alex-page/github-project-automation-plus@v0.8.3
25+
with:
26+
project: CoMPAS Pull Request Overview Board
27+
column: To do
28+
repo-token: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}

.github/workflows/build-project.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Build Project
6+
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
- 'develop'
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 30
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Cache Docker Register
27+
uses: actions/cache@v3
28+
with:
29+
path: /tmp/.buildx-cache
30+
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
31+
- name: Cache Maven packages
32+
uses: actions/cache@v3
33+
with:
34+
path: ~/.m2
35+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
36+
restore-keys: ${{ runner.os }}-m2
37+
38+
- name: Set up Docker Buildx
39+
id: buildx
40+
uses: docker/setup-buildx-action@v2
41+
- name: Set up JDK 17
42+
uses: actions/setup-java@v3
43+
with:
44+
distribution: 'zulu'
45+
java-version: '17'
46+
47+
- name: Create custom Maven Settings.xml
48+
uses: whelk-io/maven-settings-xml-action@v21
49+
with:
50+
output_file: custom_maven_settings.xml
51+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
52+
- name: Build with Maven (Pull Request)
53+
if: ${{ github.event_name == 'pull_request' }}
54+
run: ./mvnw -s custom_maven_settings.xml -B -Pnative-image clean verify
55+
- name: Build with Maven (Push)
56+
if: ${{ github.event_name == 'push' }}
57+
run: ./mvnw -s custom_maven_settings.xml -B clean verify

.github/workflows/release-project.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Release Project
6+
7+
on:
8+
release:
9+
types: [ released ]
10+
11+
jobs:
12+
release_project:
13+
name: Release project
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 30
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Cache Docker Register
22+
uses: actions/cache@v3
23+
with:
24+
path: /tmp/.buildx-cache
25+
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile') }}
26+
- name: Cache Maven packages
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.m2
30+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31+
restore-keys: ${{ runner.os }}-m2
32+
33+
- name: Extract tag name
34+
id: extract_tagname
35+
shell: bash
36+
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
37+
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
38+
39+
- name: Set up JDK 17
40+
uses: actions/setup-java@v3
41+
with:
42+
distribution: 'zulu'
43+
java-version: '17'
44+
- name: Set up Docker Buildx
45+
id: buildx
46+
uses: docker/setup-buildx-action@v2
47+
- name: Login to Docker Hub
48+
uses: docker/login-action@v2
49+
with:
50+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
51+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
52+
53+
- name: Create custom Maven Settings.xml
54+
uses: whelk-io/maven-settings-xml-action@v21
55+
with:
56+
output_file: custom_maven_settings.xml
57+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
58+
- name: Set version with Maven
59+
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
- name: Deploy with Maven to GitHub Packages and Docker Hub
63+
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/reuse.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: REUSE Compliance Check
6+
7+
on: push
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
- name: REUSE Compliance Check
16+
uses: fsfe/reuse-action@v1
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SPDX-FileCopyrightText: 2022 Alliander N.V.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: SonarCloud Analysis
6+
7+
on:
8+
push:
9+
branches:
10+
- '**'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
- 'develop'
15+
pull_request_target:
16+
branches:
17+
- 'main'
18+
- 'develop'
19+
20+
jobs:
21+
sonar-check:
22+
name: Sonar Check
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
26+
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
with:
31+
fetch-depth: 0
32+
33+
- name: Cache SonarCloud packages
34+
uses: actions/cache@v3
35+
with:
36+
path: ~/.sonar/cache
37+
key: ${{ runner.os }}-sonar
38+
restore-keys: ${{ runner.os }}-sonar
39+
- name: Cache Maven packages
40+
uses: actions/cache@v3
41+
with:
42+
path: ~/.m2
43+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
44+
restore-keys: ${{ runner.os }}-m2
45+
46+
- name: Set up JDK 17
47+
uses: actions/setup-java@v3
48+
with:
49+
distribution: 'zulu'
50+
java-version: '17'
51+
52+
- name: Set Common Sonar Variables
53+
id: sonar_env
54+
run: |
55+
echo "##[set-output name=sonar_opts;]$(echo -Dsonar.host.url=https://sonarcloud.io \
56+
-Dsonar.projectKey=com-pas_compas-sitipe-service \
57+
-Dsonar.organization=com-pas )"
58+
- name: Create custom Maven Settings.xml
59+
uses: whelk-io/maven-settings-xml-action@v21
60+
with:
61+
output_file: custom_maven_settings.xml
62+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
63+
- name: Build and analyze (Pull Request)
64+
if: ${{ github.event_name == 'pull_request' || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
68+
run: |
69+
./mvnw -B -s custom_maven_settings.xml -Psonar \
70+
${{ steps.sonar_env.outputs.sonar_opts }} \
71+
-Dsonar.pullrequest.branch=${{ github.ref_name }} \
72+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} \
73+
-Dsonar.pullrequest.base=${{ github.base_ref }} \
74+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }} \
75+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
76+
- name: Build and analyze (Push)
77+
if: ${{ github.event_name == 'push' }}
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
81+
run: |
82+
./mvnw -B -s custom_maven_settings.xml -Psonar \
83+
${{ steps.sonar_env.outputs.sonar_opts }} \
84+
-Dsonar.branch.name=${{ github.ref_name }} \
85+
clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

0 commit comments

Comments
 (0)