-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from NUM-Forschungsdatenplattform/develop
Update Keycloak
- Loading branch information
Showing
16 changed files
with
483 additions
and
64 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: maven | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: monday | ||
time: "04:00" | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
day: monday | ||
time: "03:00" |
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,36 @@ | ||
name: Build for development | ||
|
||
on: | ||
push: | ||
branches: [ 'feature/**', 'dependabot/**' ] | ||
pull_request_target: | ||
branches: [ develop, main ] | ||
types: [ ready_for_review, closed ] | ||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Run verify | ||
run: mvn verify | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
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,85 @@ | ||
name: Create release branch | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: [ develop ] | ||
inputs: | ||
release: | ||
description: 'Type of the release.' | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: minor | ||
|
||
jobs: | ||
create_branch: | ||
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/develop' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Create version | ||
id: createVersion | ||
run: | | ||
CURRENT_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec) | ||
echo "Current version: $CURRENT_VERSION" | ||
MAJOR=`echo $CURRENT_VERSION | cut -d. -f1` | ||
MINOR=`echo $CURRENT_VERSION | cut -d. -f2` | ||
PATCH=`echo $CURRENT_VERSION | cut -d. -f3 | cut -d- -f1` | ||
if [ ${{ inputs.release }} == 'major' ]; then | ||
MAJOR=$((MAJOR+1)) | ||
MINOR=0 | ||
PATCH=0 | ||
elif [ ${{ inputs.release }} == 'minor' ]; then | ||
MINOR=$((MINOR+1)) | ||
PATCH=0 | ||
else | ||
PATCH=$((PATCH+1)) | ||
fi | ||
VERSION=${MAJOR}.${MINOR}.${PATCH} | ||
echo | ||
echo "Release version: $VERSION" | ||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Create release branch | ||
env: | ||
VERSION: ${{ steps.createVersion.outputs.VERSION }} | ||
run: | | ||
git config --global user.email "github-actions@example.com" | ||
git config --global user.name "Github Actions" | ||
git branch release/$VERSION | ||
git checkout release/$VERSION | ||
mvn versions:set -DnewVersion=${VERSION}-SNAPSHOT versions:commit | ||
git add pom.xml | ||
git commit -m "updated project version to ${VERSION}" | ||
git push --set-upstream origin release/$VERSION | ||
wrong_branch: | ||
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/develop' | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: ERROR | ||
run: echo 'This workflow only runs on develop branch!' |
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,115 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
branches: [ 'release/**' ] | ||
|
||
env: | ||
RELEASE_VERSION: '' | ||
DEV_VERSION: '' | ||
|
||
jobs: | ||
|
||
read_version: | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
DEV_VERSION: ${{ steps.createVersion.outputs.DEV_VERSION}} | ||
RELEASE_VERSION: ${{ steps.createVersion.outputs.RELEASE_VERSION}} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Create new development version | ||
id: createVersion | ||
run: | | ||
CURRENT_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec) | ||
RELEASE_VERSION=`echo $CURRENT_VERSION | cut -d- -f1` | ||
echo "Current version: $CURRENT_VERSION" | ||
MAJOR=`echo $CURRENT_VERSION | cut -d. -f1` | ||
MINOR=`echo $CURRENT_VERSION | cut -d. -f2` | ||
DEV_VERSION=${MAJOR}.$((MINOR+1)).0-SNAPSHOT | ||
echo | ||
echo "Release version: $RELEASE_VERSION" | ||
echo "Develop version: $DEV_VERSION" | ||
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> "$GITHUB_OUTPUT" | ||
echo "DEV_VERSION=${DEV_VERSION}" >> "$GITHUB_OUTPUT" | ||
echo "### :rocket: ${RELEASE_VERSION}" >> $GITHUB_STEP_SUMMARY | ||
update_dev: | ||
needs: read_version | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Create branch to update develop version | ||
env: | ||
DEV_VERSION: ${{ needs.read_version.outputs.DEV_VERSION }} | ||
run: | | ||
git config --global user.email "noreply@github.com" | ||
git config --global user.name "Github Actions" | ||
git branch feature/update_develop_${DEV_VERSION} | ||
git checkout feature/update_develop_${DEV_VERSION} | ||
mvn versions:set -DnewVersion=${DEV_VERSION} versions:commit | ||
git commit -am "updated development version to ${DEV_VERSION}" | ||
git push --set-upstream origin feature/update_develop_${DEV_VERSION} | ||
- name: Create PR to merge changes to Develop and update Version | ||
env: | ||
RELEASE_VERSION: ${{ needs.read_version.outputs.RELEASE_VERSION }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
PR_URL=`gh pr create --draft -B develop --title "Merge release branch '${RELEASE_VERSION}' back to develop" --body "Merge release branch '${RELEASE_VERSION}' back to develop"` | ||
echo $PR_URL | ||
release: | ||
needs: read_version | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Set the release version | ||
env: | ||
RELEASE_VERSION: ${{ needs.read_version.outputs.RELEASE_VERSION }} | ||
run: | | ||
git config --global user.email "noreply@github.com" | ||
git config --global user.name "Github Actions" | ||
mvn versions:set -DremoveSnapshot versions:commit | ||
git commit -am "updated release version to ${RELEASE_VERSION}" | ||
git push | ||
- name: Create PR to merge release branch to main | ||
env: | ||
RELEASE_VERSION: ${{ needs.read_version.outputs.RELEASE_VERSION }} | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
PR_URL=`gh pr create --draft -B main --title "Merge release branch '${RELEASE_VERSION}'" --body "Merge release branch '${RELEASE_VERSION}'"` | ||
echo $PR_URL |
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,33 @@ | ||
name: Weekly | ||
|
||
on: | ||
schedule: | ||
- cron: '0 23 * * 1' | ||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'maven' | ||
- name: Run verify | ||
run: mvn verify | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: 'fs' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH' | ||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: 'trivy-results.sarif' |
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
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
Oops, something went wrong.