feat(exx-Pipeline): add check license

This commit is contained in:
Wolfram Gulde 2022-05-24 15:19:15 +02:00 committed by Marcel Feix
parent 7cf5bce9b4
commit 49085385fb
No known key found for this signature in database
GPG Key ID: 04D016E104A25F03

View File

@ -1,11 +1,26 @@
.license-asciidoc: .license-asciidoc:
image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-license-tools image: gitlab.exxcellent.de:4567/gilden/ci/exxcellent-license-tools
stage: license stage: verify
variables: variables:
BOM_FILE: bom.json BOM_FILE: bom.json
LICENSE_FILE: licenses.adoc LICENSE_FILE: licenses.adoc
VALID_LICENSE_FILE: valid-licenses.txt
INVALID_LICENSE_FILE: invalid-licenses.adoc
NUMBER_OF_INVALID_LICENSES: 0
script: script:
- "cd $BACKEND_DIR" - "cd $BACKEND_DIR"
- >
if [ ! -f "$VALID_LICENSE_FILE" ]; then
checkLicenseBom --bom $BOM_FILE --targetBom $INVALID_LICENSE_FILE --license $VALID_LICENSE_FILE || NUMBER_OF_INVALID_LICENSES=$?
fi
- >
if [ "$NUMBER_OF_INVALID_LICENSES" -gt 0 ]; then
echo "Invalid licenses found. Number of invalid license ${DIFF_LICENSE}"
cat $INVALID_LICENSE_FILE
exit 1
else
echo "All licenses valid"
fi
- licenseBom2Adoc --bom $BOM_FILE --adoc $LICENSE_FILE - licenseBom2Adoc --bom $BOM_FILE --adoc $LICENSE_FILE
artifacts: artifacts:
when: always when: always