Skip to content

Commit

Permalink
Update namings and README, fix artifact deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Treber committed Dec 6, 2020
1 parent c2f972b commit 370871c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ on:
jobs:
build_test_deploy:
runs-on: ubuntu-latest
name: Test building HTML of IFE model and deploy container when successfull
name: Build HTML, push container and deploy HTML
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Test building the image and exporting HTML
name: Build the image and export HTML
uses: ./
-
name: Deploy HTML to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_dir: artifacts
-
name: Push image to Dockerhub
uses: docker/build-push-action@v1
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ on:
push:
branches:
- main
- develop

jobs:
build_test:
Expand All @@ -13,4 +14,10 @@ jobs:
uses: actions/checkout@v2
-
name: Test building the image and exporting HTML
uses: ./
uses: ./
-
name: Archive HTML export and validation report
uses: actions/upload-artifact@v2
with:
name: validation-report-html-export
path: artifacts
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@ Map the folder where your model and your `entrypoint.sh` is located into the
docker run --init -v `pwd`/workdir:/workdir capella-html-exporter
```

Note: You must run eclipse in a virtual framebuffer, as it requires a X server.
### Entrypoint.sh

You must run eclipse in a virtual framebuffer, as it requires a X server.
`Xvfb` is included in the docker image.

The first step needs to import your project into the Capella workspace.
Note: It seems that Capella 1.4.2 has a bug in the
`org.polarsys.kitalpha.doc.gen.business.capella.commandline` function that does
not allow to use the `import` flag in there. There, we use the `validation` app
first, to import the project into the Capella workspace.

The `entrypoint.sh` could look like this:

```bash
Expand Down
2 changes: 2 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ description: 'Start the Capella HTML exporter Docker container'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- /github/workspace/artifacts
21 changes: 13 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

# The first commandline argument contains the folder which shall have the
# outputs of the export.
results_folder=${1:-/workdir}
mkdir -p ${results_folder}

# Unpack the example project that is delivered with Capella
pushd /opt/capella/samples
unzip IFE_samplemodel.zip
Expand All @@ -10,11 +15,11 @@ xvfb-run -s "-screen 0 1280x720x24" \
eclipse -nosplash -consoleLog \
-application org.polarsys.capella.core.commandline.core \
-appid org.polarsys.capella.core.validation.commandline \
-data /workspace \
-data /capella-workspace \
-import "/opt/capella/samples/In-Flight Entertainment System" \
-input "/In-Flight Entertainment System/In-Flight Entertainment System.aird" \
-outputfolder "/In-Flight Entertainment System/validation" \
-logfile /workdir/log.html \
-logfile ${results_folder}/log.html \
-forceoutputfoldercreation

# Export the model as HTML
Expand All @@ -24,15 +29,15 @@ xvfb-run -s "-screen 0 1280x720x24" \
eclipse -nosplash -consoleLog \
-application org.polarsys.capella.core.commandline.core \
-appid org.polarsys.kitalpha.doc.gen.business.capella.commandline \
-data /workspace \
-data /capella-workspace \
-filepath "/In-Flight Entertainment System/In-Flight Entertainment System.aird" \
-outputfolder "/In-Flight Entertainment System/html_export" \
-logfile /workdir/log.html \
-logfile ${results_folder}/log.html \
-forceoutputfoldercreation

# Copy the validation and html output to the /workdir that is mapped as a volume
cp -r "/opt/capella/samples/In-Flight Entertainment System/html_export" /workdir/html_export
cp -r "/opt/capella/samples/In-Flight Entertainment System/validation" /workdir/validation
# Copy the validation and html output to the ${results_folder}/ that is mapped as a volume
cp -r "/opt/capella/samples/In-Flight Entertainment System/html_export" ${results_folder}/html_export
cp -r "/opt/capella/samples/In-Flight Entertainment System/validation" ${results_folder}/validation

# Create index.html from stub
sed 's/model-name-to-replace/In-Flight Entertainment System/g' index_stub.html > /workdir/index.html
sed 's/model-name-to-replace/In-Flight Entertainment System/g' index_stub.html > ${results_folder}/index.html
7 changes: 5 additions & 2 deletions index_stub.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
<body>
<h1>model-name-to-replace artifacts</h1>
<p>
<a href="validation/model-name-to-replace/model-name-to-replace.aird/validation-results.html">Model Validation</a></br>
<a href="html_export/output/">Model HTML export</a>
<a href="html_export/output/">Model HTML export</a><br />
<a href="validation/model-name-to-replace/model-name-to-replace.aird/validation-results.html">Model Validation</a>
</p>
<p>
<a href="log.html">Log</a>
</p>
</body>
</html>

0 comments on commit 370871c

Please sign in to comment.