|
6 | 6 |
|
7 | 7 | version: 0.1 |
8 | 8 | component: build |
9 | | -timeoutInSeconds: 1000 |
| 9 | +timeoutInSeconds: 3600 |
10 | 10 | shell: bash |
11 | 11 |
|
12 | 12 | steps: |
| 13 | + - type: Command |
| 14 | + name: "Install Java 17 " |
| 15 | + command: | |
| 16 | + yum install -y java-17-openjdk java-17-openjdk-devel |
| 17 | + - type: Command |
| 18 | + name: "Install Ant " |
| 19 | + command: | |
| 20 | + wget https://dlcdn.apache.org//ant/binaries/apache-ant-1.10.15-bin.tar.gz |
| 21 | + tar xzf apache-ant-1.10.15-bin.tar.gz -C ${OCI_PRIMARY_SOURCE_DIR} |
| 22 | + - type: Command |
| 23 | + name: "Update git" |
| 24 | + command: | |
| 25 | + yum update git |
| 26 | + - type: Command |
| 27 | + name: "Checkout submodules" |
| 28 | + command: | |
| 29 | + git submodule update --init --recursive |
| 30 | + - type: Command |
| 31 | + name: "Build netbeans" |
| 32 | + command: | |
| 33 | + export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac)))) |
| 34 | + export ANT_HOME=${OCI_PRIMARY_SOURCE_DIR}/apache-ant-1.10.15 |
| 35 | + export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH |
| 36 | + ant apply-patches |
| 37 | + ant build-netbeans |
| 38 | + - type: Command |
| 39 | + name: "Build vscode extension " |
| 40 | + command: | |
| 41 | + export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which javac)))) |
| 42 | + export ANT_HOME=${OCI_PRIMARY_SOURCE_DIR}/apache-ant-1.10.15 |
| 43 | + export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH |
| 44 | + ant build-lsp-server |
| 45 | + - type: Command |
| 46 | + name: "Download the version 10.10.0 of cdxgen globally" |
| 47 | + command: | |
| 48 | + npm install -g @cyclonedx/[email protected] |
| 49 | + - type: Command |
| 50 | + name: "Workaround to let cdxgen run on nodejs 16" |
| 51 | + command: | |
| 52 | + # cdxgen relies on a fourth-party dependency that cannot be executed in a Node.js environment running version 16 |
| 53 | + # (as installed on the build runner instance) |
| 54 | + # This is a workaround to ensure cdxgen functions correctly, even in an older Node.js environment. |
| 55 | + cd /node/node-v16.14.2-linux-x64/lib/node_modules/@cyclonedx/cdxgen && \ |
| 56 | + |
| 57 | + - type: Command |
| 58 | + name: "Generate sbom for the nbcode part" |
| 59 | + command: | |
| 60 | + cd vscode |
| 61 | + # For more details, visit https://github.com/CycloneDX/cdxgen/blob/master/README.md |
| 62 | + npx @cyclonedx/cdxgen nbcode/ -r --required-only -o ../bom-nbcode.json --json-pretty --spec-version 1.4 |
13 | 63 | - type: Command |
14 | 64 | name: "Install dependencies & cyclonedx-node-npm package" |
15 | 65 | command: | |
16 | 66 | cd vscode |
17 | | - npm install && npm install --save-dev @cyclonedx/[email protected] |
| 67 | + npm install && npm install --save-dev @cyclonedx/[email protected] |
18 | 68 | - type: Command |
19 | 69 | name: "Run cyclonedx-node-npm package" |
20 | 70 | command: | |
21 | 71 | cd vscode |
22 | 72 | # For more details, visit https://github.com/CycloneDX/cyclonedx-node-npm/blob/main/README.md |
23 | | - npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file ../artifactSBOM.json --spec-version 1.4 |
| 73 | + npx @cyclonedx/cyclonedx-npm --omit dev --output-format JSON --output-file ../bom-vscode.json --spec-version 1.4 |
| 74 | + - type: Command |
| 75 | + name: "Download CycloneDx-cli executable and install dependencies" |
| 76 | + command: | |
| 77 | + wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.24.2/cyclonedx-linux-x64 |
| 78 | + yum install -y libicu |
| 79 | + - type: Command |
| 80 | + name: "Merge multiple SBOMs using CycloneDX-cli" |
| 81 | + command: | |
| 82 | + # For more details, visit https://github.com/CycloneDX/cyclonedx-cli/blob/main/README.md |
| 83 | + chmod +x cyclonedx-linux-x64 |
| 84 | + ./cyclonedx-linux-x64 merge --input-files bom-vscode.json bom-nbcode.json --output-file merged-bom.json |
| 85 | + # This step is optional for when you need to specify the name of your modules |
| 86 | + - type: Command |
| 87 | + name: "Detect the metadata components of the SBOMs" |
| 88 | + command: | |
| 89 | + yum install -y jq |
| 90 | + for path in bom-vscode.json bom-nbcode.json; do |
| 91 | + jq -r '.metadata.component.purl' "path" >> ${OCI_PRIMARY_SOURCE_DIR}/metadataComponentPurls.txt; |
| 92 | + done |
24 | 93 | outputArtifacts: |
25 | 94 | - name: artifactSBOM |
26 | 95 | type: BINARY |
27 | | - location: ${OCI_PRIMARY_SOURCE_DIR}/artifactSBOM.json |
| 96 | + location: ${OCI_PRIMARY_SOURCE_DIR}/merged-bom.json |
| 97 | + # This step is optional for when you need to specify the name of your modules |
| 98 | + - name: metadataComponentPurls |
| 99 | + type: BINARY |
| 100 | + location: ${OCI_PRIMARY_SOURCE_DIR}/metadataComponentPurls.txt |
0 commit comments