Skip to content

Commit

Permalink
feat: Add a Gitlab template for comparing against the latest tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuestengecko committed Jul 31, 2024
1 parent 10586cb commit 197cf05
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions ci-templates/gitlab/compare-to-tag.yml
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.

0 comments on commit 197cf05

Please sign in to comment.