-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a Gitlab template for comparing against the latest tag
- Loading branch information
1 parent
10586cb
commit 197cf05
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright DB InfraGO AG and contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# yaml-language-server: $schema=https://gitlab.com/gitlab-org/gitlab/-/raw/master/app/assets/javascripts/editor/schema/ci.json | ||
|
||
compare-to-tag: | ||
image: python:3.12 | ||
script: | ||
- oldversion="$(git describe --tags --abbrev=0 || true)" | ||
- |- | ||
if ! [[ $oldversion ]]; then | ||
echo >&2 No recent tag found to compare against | ||
exit 0 | ||
fi | ||
- |- | ||
# Install capella-diff-tools vX.Y.Z from PyPI, everything else from Github | ||
if [[ ${CAPELLA_DIFF_TOOLS_VERSION:-vX.Y.Z} = v*.*.* ]]; then | ||
pip install "capella-diff-tools${CAPELLA_DIFF_TOOLS_VERSION:+==$CAPELLA_DIFF_TOOLS_VERSION}" | ||
else | ||
pip install "git+https://github.com/DSD-DBS/capella-diff-tools.git@$CAPELLA_DIFF_TOOLS_VERSION" | ||
fi | ||
- capella-diff-tool ${ENTRYPOINT:-.} "$oldversion" HEAD -o model-diff.yml -r model-diff.html | ||
|
||
artifacts: | ||
paths: [model-diff.html, model-diff.yml] | ||
|
||
variables: | ||
CAPELLA_DIFF_TOOLS_VERSION: | ||
description: Version of capella-diff-tools to install. Should be the same as the version of this template. |