Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Textgrid Repository WebDAV Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DARIAH-DE
TextGridRep
Textgrid Repository WebDAV Server
Merge requests
!23
Resolve "generate and upload sbom on release"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "generate and upload sbom on release"
35-generate-and-upload-sbom-on-release
into
main
Overview
1
Commits
2
Pipelines
2
Changes
3
Merged
Stefan Hynek
requested to merge
35-generate-and-upload-sbom-on-release
into
main
2 years ago
Overview
1
Commits
2
Pipelines
2
Changes
3
Expand
Closes
#35 (closed)
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
8ec20b88
2 commits,
2 years ago
3 files
+
3116
−
1441
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
.gitlab-ci.yml
+
47
−
4
Options
@@ -7,16 +7,18 @@ workflow:
rules
:
-
if
:
$CI_MERGE_REQUEST_IID
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-
if
:
$CI_COMMIT_TAG
stages
:
-
test
-
release
-
build
-
deploy
variables
:
harbor_registry
:
"
harbor.gwdg.de"
harbor_repo
:
"
sub-fe"
project_name
:
"
repdav"
lint dockerfile
:
stage
:
test
@@ -40,7 +42,7 @@ lint dockerfile:
release
:
stage
:
release
image
:
docker.io/node:1
6
.1
4
image
:
docker.io/node:1
8
.1
2
before_script
:
-
npm ci --unsafe-perm
script
:
@@ -66,8 +68,49 @@ build container image:
--build-arg build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
--build-arg vcs_ref=${CI_COMMIT_SHORT_SHA}
--build-arg version=${version}
--destination $CI_REGISTRY_IMAGE/
repdav
:$version
--destination $harbor_registry/$harbor_repo/
repdav
:$version
--destination $CI_REGISTRY_IMAGE/
$project_name
:$version
--destination $harbor_registry/$harbor_repo/
$project_name
:$version
rules
:
# prevent job creation on release commits to $CI_DEFAULT_BRANCH
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_MESSAGE =~ /^chore\(release\):/
when
:
never
-
if
:
$CI_MERGE_REQUEST_IID
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
-
if
:
$CI_COMMIT_TAG
generate app sbom
:
stage
:
deploy
image
:
docker.io/node:18.12
before_script
:
-
npm ci --ignore-scripts
-
npm run build
script
:
-
npx cdxgen
--type nodejs
--required-only
--server-url https://deps.sub.uni-goettingen.de
--api-key ${DEPS_UPLOAD_TOKEN}
--project-name ${project_name}
--project-version ${CI_COMMIT_TAG}
rules
:
-
if
:
$CI_COMMIT_TAG
generate container sbom
:
stage
:
deploy
image
:
docker.io/alpine:3.16
before_script
:
-
apk add curl
-
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin
script
:
-
syft --output cyclonedx-json --file bom.json
$CI_REGISTRY_IMAGE/${project_name}:${CI_COMMIT_TAG}
-
'
curl
-X
POST
"https://deps.sub.uni-goettingen.de/api/v1/bom"
--header
"accept:
application/json"
--header
"X-Api-Key:
${DEPS_UPLOAD_TOKEN}"
--header
"Content-Type:
multipart/form-data"
--form
"autoCreate=true"
--form
"projectName=${project_name}-container"
--form
"projectVersion=${CI_COMMIT_TAG}"
--form
"bom=@bom.json"'
rules
:
-
if
:
$CI_COMMIT_TAG
Loading