Commit 61bb8661 authored by David Diederich's avatar David Diederich
Browse files

Adding a step to set the CI_COMMIT_BRANCH name to the tag name if it doesn't exist.

Slightly hacky, but it doesn't require flexibility in the fossa-check-for-licensing-issues step, we can configure within the pipeline instead.

(cherry picked from commit f999bb42)
parent 35628e87
Pipeline #15062 passed with stage
in 11 seconds
......@@ -10,6 +10,11 @@ fossa-analyze:
- $FOSSA_API_KEY
script:
# fossa-check-for-licensing-issues needs a CI_COMMIT_BRANCH defined to know how to parse the FOSSA API results
# When building tags, this isn't defined by GitLab. In that case, we use the tag name instead. If that's not defined
# then things will fail and we'll have to make this smarter
- test -z "$CI_COMMIT_BRANCH" && export CI_COMMIT_BRANCH="$CI_COMMIT_TAG"
- $MAVEN install -DskipTests=true
- cp "$CI_PROJECT_DIR/.mvn/community-maven.settings.xml" ~/.m2/settings.xml
- fossa analyze --project "${CI_PROJECT_TITLE}" --project-url "${CI_PROJECT_URL}" --branch "${CI_COMMIT_BRANCH}"
......@@ -38,6 +43,9 @@ fossa-check-notice:
- public
script:
# See comments about this line from fossa-analyze
- test -z "$CI_COMMIT_BRANCH" && export CI_COMMIT_BRANCH="$CI_COMMIT_TAG"
- mkdir -p public
- fossa report licenses --project "${CI_PROJECT_TITLE}" --branch "${CI_COMMIT_BRANCH}" > public/NOTICE
- mkdir committed-NOTICE generated-NOTICE
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment