Skip to content

Commit

Permalink
FUSETOOLS2-2207: Generate sbom for vscode extensions on jenkins
Browse files Browse the repository at this point in the history
- Add step to generate sbom using cyclonedx and cyclonedx-npm
- Add cyclonedx to the install requirements step
  • Loading branch information
hdamarcelo committed Feb 1, 2024
1 parent bea9496 commit b7c2648
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ node('rhel8'){
sh "curl -Ls https://sh.jbang.dev | bash -s - app setup"
env.PATH="~/.jbang/bin:${env.PATH}"
sh "jbang trust add https://github.com/apache/"
//install cyclonedx-npm
sh "npm install --global @cyclonedx/cyclonedx-npm"
//install cyclonedx:
sh "wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.25.0/cyclonedx-linux-x64"
sh "chmod +x cyclonedx-linux-x64"
}

stage('Build') {
Expand Down Expand Up @@ -51,6 +56,20 @@ node('rhel8'){
sh "sftp -C ${UPLOAD_LOCATION}/snapshots/vscode-apache-camel/ <<< \$'put -p -r ${tgzFilesToPush[0].path}'"
}
}

stage('Generate SBOM'){
packageVersion = sh(script: 'jq -rcM .version < package.json', returnStdout: true ).trim()
sh "cyclonedx-npm --omit dev --output-file node-sbom.json"
sh """./cyclonedx-linux-x64 merge \
--hierarchical \
--group com.github.camel-tooling \
--name vscode-apache-camel \
--version ${packageVersion} \
--input-files node-sbom.json camel-ls-sbom.json \
--output-file manifest.json
"""
archiveArtifacts artifacts:"manifest.json"
}
}

node('rhel8'){
Expand Down

0 comments on commit b7c2648

Please sign in to comment.