Skip to content
Snippets Groups Projects

ozg-7492 upload sbom

Merged Bastian Heppener requested to merge ozg-7492-sbom-dependency-tracker into main
1 unresolved thread
1 file
+ 25
6
Compare changes
  • Side-by-side
  • Inline
+ 25
6
@@ -5,7 +5,6 @@ pipeline {
@@ -5,7 +5,6 @@ pipeline {
}
}
}
}
tools { go 'go-1.22.0' }
environment {
environment {
RELEASE_REGEX = /v\d+.\d+.\d+/
RELEASE_REGEX = /v\d+.\d+.\d+/
BETA_REGEX = /v\d+.\d+.\d+-beta.\d/
BETA_REGEX = /v\d+.\d+.\d+-beta.\d/
@@ -59,9 +58,6 @@ tools { go 'go-1.22.0' }
@@ -59,9 +58,6 @@ tools { go 'go-1.22.0' }
FAILED_STAGE=env.STAGE_NAME
FAILED_STAGE=env.STAGE_NAME
sh '''
sh '''
#export GOPATH so that installed dependencies could be found
export GOPATH=$GOROOT
go mod download
go mod download
go install \
go install \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
@@ -75,8 +71,7 @@ tools { go 'go-1.22.0' }
@@ -75,8 +71,7 @@ tools { go 'go-1.22.0' }
chmod +x ./buf
chmod +x ./buf
./buf generate
./buf generate
#to compile go statically with these tags, so that the binary is not dynamically linked and from scratch in Dockerfile will work
#to compile go statically with these tags, so that the binary is not dynamically linked and from scratch in Dockerfile will work
go build -tags osusergo,netgo cmd/info-manager-proxy/main.go
go build -tags osusergo,netgo cmd/info-manager-proxy/main.go
'''
'''
}
}
}
}
@@ -162,6 +157,30 @@ tools { go 'go-1.22.0' }
@@ -162,6 +157,30 @@ tools { go 'go-1.22.0' }
}
}
}
}
}
}
 
 
stage ('Deploy SBOM to DependencyTrack') {
 
when {
 
anyOf {
 
branch 'main'
 
branch 'release'
 
}
 
}
 
steps {
 
script {
 
catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') {
 
sh '''
 
go install github.com/CycloneDX/cyclonedx-gomod/cmd/cyclonedx-gomod@latest
 
go env -w GOFLAGS=-buildvcs=false
 
 
cyclonedx-gomod version
 
cyclonedx-gomod app -main cmd/info-manager-proxy/ -output sbom.xml
 
'''
 
 
dependencyTrackPublisher artifact: 'sbom.xml', projectName: 'info-manager-proxy', projectVersion: env.BRANCH_NAME, synchronous: true
 
}
 
}
 
}
 
}
}
}
}
}
Loading