Skip to content

Commit

Permalink
feat: Add envvars and a first version of the ci-template
Browse files Browse the repository at this point in the history
  • Loading branch information
micha91 committed Nov 19, 2024
1 parent 37fd9a9 commit 4a5b0f0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions capella_ros_tools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,21 @@ def import_msgs(
type=cli_helpers.ModelCLI(),
required=True,
help="Path to the Capella model.",
envvar="CAPELLA_ROS_TOOLS_MODEL",
)
@click.option(
"-l",
"--layer",
type=click.Choice(["oa", "la", "sa", "pa"], case_sensitive=False),
help="The layer to export the model objects from.",
envvar="CAPELLA_ROS_TOOLS_LAYER",
)
@click.option(
"-r",
"--root",
type=click.UUID,
help="The UUID of the root package to import the messages from.",
envvar="CAPELLA_ROS_TOOLS_ROOT_PACKAGE",
)
@click.option(
"-o",
Expand Down
18 changes: 18 additions & 0 deletions ci-templates/gitlab/export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright DB InfraGO AG and contributors
# SPDX-License-Identifier: Apache-2.0

variables:
CAPELLA_ROS_TOOLS_MODEL: "."
CAPELLA_ROS_TOOLS_LAYER: "LA"
# Optional variables:
# $CAPELLA_ROS_TOOLS_VERSION - Use a specific version of the ROS tools
# $CAPELLA_ROS_TOOLS_ROOT_PACKAGE - UUID of the package to get classes from

capella_ros_exporter:
script:
# - pip install "capella-ros-tools{CAPELLA_ROS_TOOLS_VERSION:+==$CAPELLA_ROS_TOOLS_VERSION}"
- pip install git+https://github.com/DSD-DBS/capella-ros-tools.git@add-ci-pipeline
- capella-ros-tools export -o ros-export
artifacts:
paths:
- ros-export
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ test = [
"pytest-cov",
]

[project.scripts]
capella-ros-tools = "capella_ros_tools.__main__:cli"

[tool.black]
line-length = 79
target-version = ["py310"]
Expand Down

0 comments on commit 4a5b0f0

Please sign in to comment.