Skip to content

Commit

Permalink
CI: Add trivy support
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Trangoni <[email protected]>
  • Loading branch information
mjtrangoni committed Aug 12, 2024
1 parent 36a2dd6 commit ac1e44f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ jobs:
else
docker push $DOCKER_IMAGE_NAME:$CIRCLE_BRANCH
fi
- run:
name: Install trivy
command: |
apk add --update-cache --upgrade curl
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
- run:
name: Scan the local image with trivy
command: |
if [ -n "$CIRCLE_TAG" ]; then
trivy image --exit-code 0 --no-progress $DOCKER_IMAGE_NAME:latest
else
trivy image --exit-code 0 --no-progress docker push $DOCKER_IMAGE_NAME:$CIRCLE_BRANCH
fi
release:
executor: golang
Expand Down

0 comments on commit ac1e44f

Please sign in to comment.