Skip to content

Commit

Permalink
Add sbom pipeline (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-lmu authored Jan 27, 2025
1 parent 4469af9 commit 091a1ca
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lerna-debug.log*
junit.xml
eslint.xml
report.xml
bom.json

test-results/
.vscode-test/
Expand Down
37 changes: 37 additions & 0 deletions build/sbom/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pipeline {
agent any

options {
buildDiscarder(logRotator(numToKeepStr: '30', artifactNumToKeepStr: '20'))
}

triggers {
cron '@midnight'
}

stages {
stage('build') {
steps {
script {
if (isReleasingBranch()) {
docker.build('node', '-f build/Dockerfile .').inside {
withCredentials([string(credentialsId: 'dependency-track', variable: 'API_KEY')]) {
sh 'npm run update:axonivy:next'
sh 'npm install'
sh 'npm run sbom'
def version = sh (script: "node -p \"require('./extension/package.json').version\"", returnStdout: true)
sh 'curl -v --fail -X POST https://api.dependency-track.ivyteam.io/api/v1/bom \
-H "Content-Type: multipart/form-data" \
-H "X-API-Key: ' + API_KEY + '" \
-F "autoCreate=true" \
-F "projectName=vscode-extensions" \
-F "projectVersion=' + version + '" \
-F "[email protected]"'
}
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"package": "lerna run package",
"package:with:engine": "lerna run package:with:engine",
"publish:next": "lerna run publish:next",
"sbom": "npx --yes @cyclonedx/cyclonedx-npm --output-format JSON --output-file bom.json",
"test:playwright": "npm run --workspace=@axonivy/vscode-extensions-playwright ui-tests",
"test:playwright:stable": "RUN_STABLE_VERSION=true npm run test:playwright",
"test:playwright:browser": "RUN_IN_BRWOSER=true npm run test:playwright",
Expand Down

0 comments on commit 091a1ca

Please sign in to comment.