generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into fix-dienstleisterkennung
- Loading branch information
Showing
6 changed files
with
21,715 additions
and
6,442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,45 @@ | ||
name: build and test | ||
name: compliance check and build test | ||
|
||
on: [push] | ||
|
||
jobs: | ||
compliance: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Advance Security Policy as Code | ||
uses: advanced-security/policy-as-code@v2.0 | ||
uses: advanced-security/policy-as-code@v2.1.2 | ||
with: | ||
policy: GeekMasher/security-queries | ||
policy-path: policies/default.yml | ||
|
||
token: ${{ secrets.ACCESS_TOKEN }} | ||
|
||
argvs: '--disable-dependabot --disable-secret-scanning --disable-code-scanning' | ||
|
||
build-maven: | ||
needs: compliance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "11" | ||
distribution: "temurin" | ||
cache: "maven" | ||
|
||
- name: Set up Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build with Maven | ||
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build feature branch | ||
|
||
on: [workflow_dispatch] | ||
|
||
jobs: | ||
build-and-docker-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "11" | ||
distribution: "temurin" | ||
cache: "maven" | ||
|
||
- name: Set up Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build with Maven | ||
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true | ||
|
||
- uses: gacts/github-slug@v1 | ||
id: slug | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_KEY }} | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: itatm/dave-admin-portal:${{ steps.slug.outputs.branch-name-slug }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: release | ||
|
||
# Run workflow on commits to the `main` branch | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
if_merged: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ssh-key: ${{ secrets.SECRET_KEY }} | ||
|
||
- name: Install Java and Maven | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 11 | ||
distribution: "temurin" | ||
cache: "maven" | ||
- name: Set up Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Clean Maven Project Version | ||
id: set-version | ||
run: | | ||
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "Current version: $current_version" | ||
new_version=$(echo $current_version | sed 's/-SNAPSHOT//') | ||
echo "New version: $new_version" | ||
mvn -B versions:set -DnewVersion=$new_version | ||
mvn -B versions:set -DnewVersion=$new_version -DprocessAllModules | ||
git config --global user.email "github-actions@github.com" | ||
git config --global user.name "GitHub Actions" | ||
git add pom.xml | ||
git add **/pom.xml | ||
git commit -m "Bump main version to $new_version" | ||
git push | ||
echo "::set-output name=new_version::$new_version" | ||
- name: Build with Maven | ||
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_KEY }} | ||
|
||
- name: Build and push app | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: itatm/dave-admin-portal:${{ steps.set-version.outputs.new_version }},itatm/dave-admin-portal:latest | ||
|
||
- name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_KEY }} | ||
repository: itatm/dave-admin-portal | ||
short-description: Über das Adminportal können Zählstellen angelegt und bearbeitet werden. | ||
|
||
# github-release: | ||
# needs: if_merged | ||
# name: Create Release | ||
# # if: github.event.inputs.snapshot-build == 'n' | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Create tag | ||
# uses: actions/github-script@v6 | ||
# with: | ||
# script: | | ||
# github.rest.git.createRef({ | ||
# owner: context.repo.owner, | ||
# repo: context.repo.repo, | ||
# ref: 'refs/tags/${{ github.event.inputs.release-tag }}', | ||
# sha: context.sha | ||
# }) | ||
# - name: Create GitHub Release | ||
# id: create_release | ||
# uses: softprops/action-gh-release@v1 | ||
# with: | ||
# tag_name: ${{ github.event.inputs.release-tag }} | ||
# draft: false | ||
# prerelease: false | ||
# generate_release_notes: true | ||
# - name: Update Docker Hub Description | ||
# uses: peter-evans/dockerhub-description@v3 | ||
# with: | ||
# username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_KEY }} | ||
# repository: itatm/dave-frontend | ||
# readme-filepath: ./IMAGE_README.md | ||
# short-description: ${{ github.event.repository.description }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Build snapshot container | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Which part of the version to increase (major, minor, patch)' | ||
required: false | ||
default: 'none' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
ssh-key: ${{ secrets.SECRET_KEY }} | ||
|
||
- name: Set Maven Project Version | ||
id: set-version | ||
run: | | ||
current_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
echo "Current version: $current_version" | ||
if [ "${{ github.event.inputs.version }}" == "none" ]; then | ||
new_version="$current_version" | ||
elif [ "${{ github.event.inputs.version }}" == "major" ]; then | ||
new_version=$(echo $current_version | awk -F. -v OFS=. '{$1=$1+1; $2=0; $3=0; print $0"-SNAPSHOT"}') | ||
elif [ "${{ github.event.inputs.version }}" == "minor" ]; then | ||
new_version=$(echo $current_version | awk -F. -v OFS=. '{$2=$2+1; $3=0; print $0"-SNAPSHOT"}') | ||
else | ||
new_version=$(echo $current_version | awk -F. -v OFS=. '{$3=$3+1; print $0"-SNAPSHOT"}') | ||
fi | ||
echo "New version: $new_version" | ||
mvn -B versions:set -DnewVersion=$new_version | ||
mvn -B versions:set -DnewVersion=$new_version -DprocessAllModules | ||
if [ "${{ github.event.inputs.version }}" != "none" ]; then | ||
git config --global user.email "github-actions@github.com" | ||
git config --global user.name "GitHub Actions" | ||
git add pom.xml | ||
git add **/pom.xml | ||
git commit -m "Bump version to $new_version" | ||
git push | ||
fi | ||
echo "::set-output name=new_version::$new_version" | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "11" | ||
distribution: "temurin" | ||
cache: "maven" | ||
|
||
- name: Set up Node 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build with Maven | ||
run: mvn -B verify "-Dspring-boot.run.jvmArguments=-Dfile.encoding=UTF-8" -DskipTests=true | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_KEY }} | ||
|
||
- name: Build and push image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: itatm/dave-admin-portal:${{ steps.set-version.outputs.new_version }} | ||
|
||
- name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_KEY }} | ||
repository: itatm/dave-admin-portal | ||
short-description: Über das Adminportal können Zählstellen angelegt und bearbeitet werden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM registry.access.redhat.com/ubi8/openjdk-11:latest | ||
|
||
COPY apigateway/target/*.jar /deployments/spring-boot-application.jar |
Oops, something went wrong.