-
Notifications
You must be signed in to change notification settings - Fork 0
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 #11 from gematik/feature/ci-cd-concept
Feature/ci cd concept
- Loading branch information
Showing
25 changed files
with
1,543 additions
and
72 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,84 @@ | ||
name: Automatic Image Generation | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'src/plantuml/**' | ||
- 'src/drawio/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
generate_images: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 # Updated to Node.js 20 compatible version | ||
with: | ||
fetch-depth: 2 # Ensures at least two commits are fetched | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/[email protected] # Updated to Node.js 20 compatible version | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y graphviz xdotool xvfb | ||
sudo snap install drawio --classic | ||
- name: Download PlantUML jar | ||
run: | | ||
wget https://github.com/plantuml/plantuml/releases/latest/download/plantuml.jar -O /usr/local/bin/plantuml.jar | ||
- name: Check for changed files | ||
id: changed_files | ||
run: | | ||
BASE_SHA=$(git rev-parse HEAD^1) | ||
CHANGED_FILES=$(git diff --name-only $BASE_SHA HEAD | grep -E 'src/plantuml/.*\.puml|src/drawio/.*\.drawio' || true) | ||
echo "changed_files=$CHANGED_FILES" >> $GITHUB_ENV | ||
echo "::set-output name=changed_files::$CHANGED_FILES" | ||
- name: Debug changed files | ||
run: | | ||
echo "Debug: Changed files are ${{ steps.changed_files.outputs.changed_files }}" | ||
- name: Generate images from changed PlantUML files | ||
if: ${{ steps.changed_files.outputs.changed_files }} != '' | ||
run: | | ||
for file in $(echo "${{ steps.changed_files.outputs.changed_files }}" | grep 'src/plantuml/.*\.puml' || true); do | ||
echo "Processing PlantUML file: $file" | ||
output_dir=$(dirname "$file" | sed 's|^src/plantuml|images|') | ||
mkdir -p "$output_dir" | ||
java -jar /usr/local/bin/plantuml.jar -tpng "$file" -o "${PWD}/$output_dir" | ||
java -jar /usr/local/bin/plantuml.jar -tsvg "$file" -o "${PWD}/$output_dir" | ||
done | ||
- name: Generate images from changed drawio files | ||
if: ${{ steps.changed_files.outputs.changed_files }} != '' | ||
run: | | ||
for file in $(echo "${{ steps.changed_files.outputs.changed_files }}" | grep 'src/drawio/.*\.drawio' || true); do | ||
echo "Processing drawio file: $file" | ||
output_dir=$(dirname "$file" | sed 's|^src/drawio|images|') | ||
mkdir -p "$output_dir" | ||
xvfb-run -a drawio -x -f png -o "${PWD}/$output_dir/$(basename "$file" .drawio).png" "$file" | ||
xvfb-run -a drawio -x -f svg -o "${PWD}/$output_dir/$(basename "$file" .drawio).svg" "$file" | ||
done | ||
- name: Debug images folder | ||
run: | | ||
echo "Contents of the images folder:" | ||
ls -R images | ||
- name: Commit and push generated images | ||
if: ${{ steps.changed_files.outputs.changed_files }} != '' | ||
run: | | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '[email protected]' | ||
git add -A images | ||
git commit -m "Generate images from changed PlantUML and drawio files" | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
*.tar.gz | ||
*.pyc | ||
__pycache__/ | ||
var/ | ||
var/ | ||
console |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
# pip-pap-service configuration file | ||
|
||
# Base path for bundle storage | ||
bundle_storage_path: /var/tmp/fastapi-pip-pap | ||
# GitHub repository for bundle storage | ||
github_repo: https://raw.githubusercontent.com/gem-cp/zt-opa-bundles/main | ||
|
||
# logging configuration | ||
logging: | ||
loglevel: DEBUG | ||
loglevel: INFO | ||
log_to_console: True | ||
log_to_file: True | ||
# If log _to_file is True then the logfile is: <service_name>.log | ||
# If log_to_file is True then the logfile is: <service_name>.log | ||
service_name: fastapi-pip-pap |
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.