Skip to content

Commit 197cf05

Browse files
committed
feat: Add a Gitlab template for comparing against the latest tag
1 parent 10586cb commit 197cf05

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright DB InfraGO AG and contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
# yaml-language-server: $schema=https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json
4+
5+
compare-to-tag:
6+
image: python:3.12
7+
script:
8+
- oldversion="$(git describe --tags --abbrev=0 || true)"
9+
- |-
10+
if ! [[ $oldversion ]]; then
11+
echo >&2 No recent tag found to compare against
12+
exit 0
13+
fi
14+
- |-
15+
# Install capella-diff-tools vX.Y.Z from PyPI, everything else from Github
16+
if [[ ${CAPELLA_DIFF_TOOLS_VERSION:-vX.Y.Z} = v*.*.* ]]; then
17+
pip install "capella-diff-tools${CAPELLA_DIFF_TOOLS_VERSION:+==$CAPELLA_DIFF_TOOLS_VERSION}"
18+
else
19+
pip install "git+https://github.com/DSD-DBS/capella-diff-tools.git@$CAPELLA_DIFF_TOOLS_VERSION"
20+
fi
21+
- capella-diff-tool ${ENTRYPOINT:-.} "$oldversion" HEAD -o model-diff.yml -r model-diff.html
22+
23+
artifacts:
24+
paths: [model-diff.html, model-diff.yml]
25+
26+
variables:
27+
CAPELLA_DIFF_TOOLS_VERSION:
28+
description: Version of capella-diff-tools to install. Should be the same as the version of this template.

0 commit comments

Comments
 (0)