Skip to content
Snippets Groups Projects
Commit c661f775 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Add explicit trivy version

parent 7e18938a
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!25Add explicit trivy version
......@@ -9,6 +9,7 @@ stages:
variables:
CI_REGISTRY: ${CODE_REGISTRY}
CI_REGISTRY_IMAGE: ${CODE_REGISTRY_IMAGE}
TRIVY_VERSION: "0.11.0"
# docker variables
DOCKER_DRIVER: overlay2
FROM_IMAGE: ${CODE_REGISTRY}/devops/images/usgs/centos:latest
......@@ -167,14 +168,8 @@ Scan Docker Image:
- tags@ghsc/geomag/geomag-algorithms
script:
# install trivy
- apk add --update-cache --upgrade curl grep rpm sed
- VERSION=$(
curl --silent "https://api.github.com/repos/aquasecurity/trivy/releases/latest" | \
grep '"tag_name":' | \
sed -E 's/.*"v([^"]+)".*/\1/'
)
- wget https://github.com/aquasecurity/trivy/releases/download/v${VERSION}/trivy_${VERSION}_Linux-64bit.tar.gz
- tar zxvf trivy_${VERSION}_Linux-64bit.tar.gz
- wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION}/trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
- tar zxvf trivy_${TRIVY_VERSION}_Linux-64bit.tar.gz
# run trivy
- ./trivy --exit-code 0 --no-progress ${INTERNAL_IMAGE}
services:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment