Skip to content

Commit 3865bb6

Browse files
young-yang03Young Yang
andauthored
modified: .circleci/config.yml (#1122)
modified: Dockerfile_mbtci_template modified: internal/commands/commands.go Co-authored-by: Young Yang <young.yang03@sap.com>
1 parent af04ccd commit 3865bb6

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,8 @@ jobs:
141141
CYCLONEDX_NPM_PACKAGE=@cyclonedx/cyclonedx-npm
142142
CYCLONEDX_NPM_VERSION=1.11.0
143143
CYCLONEDX_NPM_BINARY=cyclonedx-npm
144-
npm install ${CYCLONEDX_NPM_PACKAGE}@${CYCLONEDX_NPM_VERSION} --no-save
145-
echo "${CYCLONEDX_NPM_BINARY} -h"
146-
npx ${CYCLONEDX_NPM_BINARY} -h
144+
echo "npx ${CYCLONEDX_NPM_PACKAGE}@${CYCLONEDX_NPM_VERSION} -h"
145+
npx ${CYCLONEDX_NPM_PACKAGE}@${CYCLONEDX_NPM_VERSION} -h
147146
- run:
148147
name: build mbt binary
149148
command: |

Dockerfile_mbtci_template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
293293
&& echo "cyclonedx-gomod smoke tests!" \
294294
&& cyclonedx-gomod version
295295

296+
# Install cyclonedx-npm
297+
RUN set -ex \
298+
&& npm install --prefix /usr/local/ -g ${CYCLONEDX_NPM_PACKAGE}@${CYCLONEDX_NPM_VERSION} \
299+
# smoke test
300+
&& echo "${CYCLONEDX_NPM_BINARY} install smoke test!" \
301+
&& ${CYCLONEDX_NPM_BINARY} --version
302+
296303
# Install curl and ca-certificates
297304
RUN set -ex \
298305
&& apt-get update \

internal/commands/commands.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,10 @@ func GetModuleSBomGenCommands(loc *dir.Loc, module *mta.Module,
344344
case "npm", "npm-ci", "grunt", "evo":
345345
cmd = "npm install"
346346
cmds = append(cmds, cmd)
347-
cmd = "npm install " + cyclonedx_npm + "@" + cyclonedx_npm_version + " --no-save"
348-
cmds = append(cmds, cmd)
349-
cmd = "npx cyclonedx-npm --output-format " + strings.ToUpper(sbomFileType) + " --spec-version " + cyclonedx_npm_schema_version + " --output-file " + sbomFileName + sbomFileSuffix
347+
// cmd = "npm install " + cyclonedx_npm + "@" + cyclonedx_npm_version + " --no-save"
348+
// cmds = append(cmds, cmd)
349+
// cmd = "npx cyclonedx-npm --output-format " + strings.ToUpper(sbomFileType) + " --spec-version " + cyclonedx_npm_schema_version + " --output-file " + sbomFileName + sbomFileSuffix
350+
cmd = "npx " + cyclonedx_npm + "@" + cyclonedx_npm_version + " --output-format " + strings.ToUpper(sbomFileType) + " --spec-version " + cyclonedx_npm_schema_version + " --output-file " + sbomFileName + sbomFileSuffix
350351
cmds = append(cmds, cmd)
351352
case "golang":
352353
cmd = "cyclonedx-gomod mod -output-version 1.4 -licenses -output " + sbomFileName + sbomFileSuffix

0 commit comments

Comments
 (0)