Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
replace cyclonedx-cli with ruby gem
Browse files Browse the repository at this point in the history
  • Loading branch information
Kagemaru committed Dec 22, 2022
1 parent 391b242 commit 18cf4df
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/reusable-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@ jobs:
push: true
tags: ${{ env.DECIDIM_IMAGE_REPO }}:latest
build-args: |
GITHUB_SHA=$GITHUB_SHA
GITHUB_REPOSITORY=$GITHUB_REPOSITORY
GITHUB_REF_NAME=$GITHUB_REF_NAME
PUZZLE_DEP_TRACK_URL=${{ secrets.PUZZLE_DEP_TRACK_URL }}
PUZZLE_DEP_TRACK_TOKEN=${{ secrets.PUZZLE_DEP_TRACK_TOKEN }}
56 changes: 36 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -141,29 +141,45 @@ RUN rm -rf vendor/cache/ .git spec/ node_modules/
# Send SBOM to Dependency Tracker
RUN bash -vxc "\
if [[ -n \"${PUZZLE_DEP_TRACK_TOKEN}\" ]]; then \
curl \
-L \
-o /tmp/cyclonedx-cli \
'https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${CYCLONEDX_CLI_VERSION}/cyclonedx-linux-x64' \
&& chmod a+x /tmp/cyclonedx-cli \
&& /tmp/cyclonedx-cli \
add files \
--no-input \
--base-path /app-src \
--output-file /app-src/sbom.json \
--output-format json \
gem install cyclonedx-ruby \
&& cyclonedx-ruby -v -p /app-src/ -o /app-src/sbom.xml \
&& curl \
-X 'POST' \
-i \
-H 'Content-Type: multipart/form-data' \
-H 'X-Api-Key: ${PUZZLE_DEP_TRACK_TOKEN}' \
-F 'autoCreate=true' \
-F 'projectName=${BUILD_REPO}' \
-F 'projectVersion=${BUILD_COMMIT}' \
-F 'bom=@/app-src/sbom.json' \
'${PUZZLE_DEP_TRACK_URL}'; \
-X 'POST' \
-i \
-H 'Content-Type: multipart/form-data' \
-H 'X-Api-Key: ${PUZZLE_DEP_TRACK_TOKEN}' \
-F 'autoCreate=true' \
-F 'projectName=${BUILD_REPO}' \
-F 'projectVersion=${BUILD_COMMIT}' \
-F 'bom=@/app-src/sbom.xml' \
'${PUZZLE_DEP_TRACK_URL}'; \
fi"

# RUN bash -vxc "\
# if [[ -n \"${PUZZLE_DEP_TRACK_TOKEN}\" ]]; then \
# curl \
# -L \
# -o /tmp/cyclonedx-cli \
# 'https://github.com/CycloneDX/cyclonedx-cli/releases/download/v${CYCLONEDX_CLI_VERSION}/cyclonedx-linux-x64' \
# && chmod a+x /tmp/cyclonedx-cli \
# && /tmp/cyclonedx-cli \
# add files \
# --no-input \
# --base-path /app-src \
# --output-file /app-src/sbom.json \
# --output-format json \
# && curl \
# -X 'POST' \
# -i \
# -H 'Content-Type: multipart/form-data' \
# -H 'X-Api-Key: ${PUZZLE_DEP_TRACK_TOKEN}' \
# -F 'autoCreate=true' \
# -F 'projectName=${BUILD_REPO}' \
# -F 'projectVersion=${BUILD_COMMIT}' \
# -F 'bom=@/app-src/sbom.json' \
# '${PUZZLE_DEP_TRACK_URL}'; \
# fi"

##################################################################
# Run Stage #
##################################################################
Expand Down

0 comments on commit 18cf4df

Please sign in to comment.