Skip to content

chgio/python4capella-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python4capella-docker

Docker Pulls GitHub Actions Workflow Status

Docker image to run Python4Capella scripts on Capella models, for continuous integration or containerised testing.

Installation

$ docker pull chgio/python4capella-docker:latest

Usage

With sample content

The container comes pre-packaged with a number of sample Python4Capella scripts and the sample In-Flight Entertainment System Capella model, so you can get a taste of how it works with:

$ docker run chgio/python4capella-docker:latest \
  sample/scripts/Python4Capella-Scripts/List_logical_components_in_console.py \
  sample/models/In-Flight\ Entertainment\ System/In-Flight\ Entertainment\ System.aird

With custom content

The container expects bind mounts at /workspace/user/scripts and /workspace/user/models, so you can run your custom Python4Capella script on your custom Capella model with:

$ docker run \
  -v <path to Python4Capella project>:/workspace/user/scripts/<name of Python4Capella project> \
  -v <path to Capella project>:/workspace/user/models/<name of Capella project> \
  chgio/python4capella-docker:latest \
  /user/scripts/<name of Python4Capella project>/<path to Python4Capella script>.py \
  /user/models/<name of Python4Capella project>/<path to Capella model>.aird \
  <extra script args>

where:

field meaning
<path to Python4Capella project> local path to the directory containing the .project file for your Python4Capella project
<name of Python4Capella project> the name of your Python4Capella project, matching the one between <name> tags in its .project file
<path to Capella project> local path to the directory containing the .project file for your Capella project
<name of Capella project> the name of your Capella project, matching the one between <name> tags in its .project file
<path to Python4Capella script> path to the .py script to run, relative to <path to Python4Capella project>
<path to Capella model> path to the .aird model to run the script on, relative to <path to Capella project>
<extra script args> space-separated list of any additional arguments to feed to the Python4Capella script

Acknowledgements

The following projects were taken as significant reference on installing, configuring, and executing Capella and Python4Capella in Docker: