Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/MarkdownModelOutput.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copyright (c) Robert Bosch GmbH and LieberLieber Software GmbH
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.

name: Output Model to Markdown

on:
push:
# branches:
# - main

env:
ModelName: VacuumCleanerRobotModel.qeax

jobs:
CreateMarkdown:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:

- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

# create LemonTree.Automation License from Actions Secret
- name: PrepareLTALicense
shell: pwsh
run: |
'${{secrets.LTALICENSE}}' | Out-File -FilePath lta.lic

# download Lemontree.Automation on a runner and setup the license
- name: Run LTA on Docker
run: |

echo "preparing LemonTree.Automation Docker Container"
docker run -id --name ltacli -v "./:/data" nexus.lieberlieber.com:5000/lieberlieber/lemontree.automation:latest

echo "running LemonTree.Automation"
docker exec -i ltacli ./lemontree.automation diff --theirs /data/assets/empty.qeax --mine /data/${{env.ModelName}} --DiffReportFilename "/tmp/DiffReport.xml" --license "/data/lta.lic"

# at the moment docker cp is the best way to get data out of the docker - a mounted volume would be better but currently doesn't work in this setup

docker cp ltacli:/tmp/DiffReport.xml /tmp/DiffReport.xml
cat /tmp/DiffReport.xml

docker exec -i ltacli ./lemontree.automation svgexport --Model "/data/${{env.ModelName}}" --diagramdirectory="/tmp/" --license "/data/lta.lic"
# docker cp ltacli:/tmp/*.svg /tmp/*.svg #sadly this doesn't work
echo "files to download"
docker exec ltacli sh -c "ls /tmp/*.svg"
docker exec ltacli sh -c "ls /tmp/*.svg" | while read line; do
# Check if the line is not empty
if [ -n "$line" ]; then
echo "File to copy: $line"
# Copy the file from the container to the host machine
docker cp ltacli:/"$line" /tmp/
fi
done
echo "download finished"
ls /tmp/*.svg

- name: Archive DiffReport.xml
uses: actions/upload-artifact@v4
with:
name: DiffReport
path: /tmp/DiffReport.xml
retention-days: 5

- name: Archive svg
uses: actions/upload-artifact@v4
with:
name: SVGDiagrams
path: /tmp/*.svg
retention-days: 5





6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/.obsidian/
*.ldb
/VariantModel/output
/VariantModel/output
/VariantModel/TransformationResults
/VariantModel/TransformationResults
/lta.lic
/DiffReportSummary.md
/DiffReport.xml
69 changes: 69 additions & 0 deletions GenerateMarkdownSummary.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Define the input XML file and output Markdown file
$xmlFile = "DiffReport.xml"
$outputMarkdown = "DiffReportSummary.md"

# Load the XML file
[xml]$xmlData = Get-Content $xmlFile

Write-Output "XML DiffReport Loaded"

# Extract report metadata
$report = $xmlData.report
$creator = $report.creatorName
$version = $report.creatorVersion
$date = $report.date

# Start Markdown content
$markdown = @"
# Diff Report Summary

**Creator:** $creator
**Version:** $version
**Date:** $date
"@

# Add changes section
$markdown += "`n## Changes`n"

# Extract and summarize classifiers
foreach ($package in $report.changes.package) {
$packageName = $package.qualifiedName
Write-Output "$packageName"
if ($packageName.StartsWith("VacuumCleanerRobot")) {
$markdown += "# $packageName`n"
$changes = $package.classifier
foreach ($classifier in $changes) {
$name = $classifier.name
$umlType = $classifier.umlType
$guid = $classifier.guid

$markdown += "### $name ($umlType)`n"
$markdown += "- **GUID:** $guid`n"

# Summarize changed properties
$elements = $classifier.element
foreach ($element in $elements) {
$elementName = $element.name
$markdown += "#### Element: $elementName`n"

# List changed properties
$changedProperties = $element.changedProperties.property
foreach ($property in $changedProperties) {
$propertyName = $property.name
$Value = $property.newValue #.newValue is the Value for us as we compared with empty.

$markdown += "**Property:** $propertyName"
$markdown += " **Value:** $Value`n"
}
}
}
}
}

Write-Output "Markdowncreated!"
Write-Output $markdow

# Save the Markdown content to a file
$markdown | Out-File -FilePath $outputMarkdown -Encoding utf8

Write-Host "Markdown summary generated: $outputMarkdown"
3 changes: 3 additions & 0 deletions assets/empty.qeax
Git LFS file not shown
26 changes: 26 additions & 0 deletions testltadocker.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# test

Write-Output "Repo Path: $(Get-Location)"

sudo docker stop ltacli
sudo docker remove ltacli

sudo docker run -id --name ltacli -v "$(Get-Location):/data" nexus.lieberlieber.com:5000/lieberlieber/lemontree.automation:latest
sudo docker exec -i --user 10:10 ltacli ./lemontree.automation ConsistencyCheck --Model "/data/VacuumCleanerRobotModel.qeax" --license "/data/lta.lic"
# sudo docker exec -i ltacli ls ./data/
sudo docker exec -i --user 10:10 ltacli ./lemontree.automation diff --theirs /data/assets/empty.qeax --mine /data/VacuumCleanerRobotModel.qeax --DiffReportFilename "/tmp/DiffReport.xml" --license "/data/lta.lic"
sudo docker cp ltacli:/tmp/DiffReport.xml /tmp/DiffReport.xml

sudo cat /tmp/DiffReport.xml
sudo cat /tmp/snap-private-tmp/snap.docker/tmp/DiffReport.xml #very special if you installed docker with snap

#ls

#ls
#testcode for file writting
# ls
# docker exec -i ltacli mkdir ./app/data/svg
# ls
# touch svg/writetest.txt
# ls svg/*.*
# docker exec -i ltacli ./lemontree.automation svgexport --Model "/data/${{env.ModelName}}" --diagramdirectory="." --license "/data/lta.lic"