ci : fix
This commit is contained in:
+12
-10
@@ -77,16 +77,18 @@ jobs:
|
|||||||
--tag "$REGISTRY_IMAGE:$REVISION" .
|
--tag "$REGISTRY_IMAGE:$REVISION" .
|
||||||
docker build --target migration --build-arg VCS_REF="$REVISION" \
|
docker build --target migration --build-arg VCS_REF="$REVISION" \
|
||||||
--tag "$REGISTRY_IMAGE:migrate-$REVISION" .
|
--tag "$REGISTRY_IMAGE:migrate-$REVISION" .
|
||||||
mkdir -p "$RUNNER_TEMP/buzz-trivy-cache"
|
docker save --output "$RUNNER_TEMP/buzz-app-image.tar" "$REGISTRY_IMAGE:$REVISION"
|
||||||
for tag in "$REVISION" "migrate-$REVISION"; do
|
docker save --output "$RUNNER_TEMP/buzz-migration-image.tar" "$REGISTRY_IMAGE:migrate-$REVISION"
|
||||||
docker save --output "$RUNNER_TEMP/buzz-image.tar" "$REGISTRY_IMAGE:$tag"
|
chmod 644 "$RUNNER_TEMP/buzz-app-image.tar" "$RUNNER_TEMP/buzz-migration-image.tar"
|
||||||
docker run --rm --user "$(id -u):$(id -g)" --cap-drop=ALL --security-opt=no-new-privileges \
|
# One scanner container shares its private cache across both images.
|
||||||
--volume "$RUNNER_TEMP:/scan:ro" \
|
docker run --rm --user 0:0 --cap-drop=ALL --security-opt=no-new-privileges \
|
||||||
--volume "$RUNNER_TEMP/buzz-trivy-cache:/cache" \
|
--volume "$RUNNER_TEMP/buzz-app-image.tar:/scan/buzz-app-image.tar:ro" \
|
||||||
aquasec/trivy@sha256:bcc376de8d77cfe086a917230e818dc9f8528e3c852f7b1aff648949b6258d1c \
|
--volume "$RUNNER_TEMP/buzz-migration-image.tar:/scan/buzz-migration-image.tar:ro" \
|
||||||
image --input /scan/buzz-image.tar --cache-dir /cache --scanners vuln --severity HIGH,CRITICAL --exit-code 1
|
--entrypoint /bin/sh \
|
||||||
rm "$RUNNER_TEMP/buzz-image.tar"
|
aquasec/trivy@sha256:bcc376de8d77cfe086a917230e818dc9f8528e3c852f7b1aff648949b6258d1c \
|
||||||
done
|
-ec 'trivy image --input /scan/buzz-app-image.tar --cache-dir /tmp/trivy-cache --scanners vuln --severity HIGH,CRITICAL --exit-code 1 &&
|
||||||
|
trivy image --input /scan/buzz-migration-image.tar --cache-dir /tmp/trivy-cache --scanners vuln --severity HIGH,CRITICAL --exit-code 1'
|
||||||
|
rm "$RUNNER_TEMP/buzz-app-image.tar" "$RUNNER_TEMP/buzz-migration-image.tar"
|
||||||
docker push "$REGISTRY_IMAGE:$REVISION" | tee "$RUNNER_TEMP/buzz-app-push.log"
|
docker push "$REGISTRY_IMAGE:$REVISION" | tee "$RUNNER_TEMP/buzz-app-push.log"
|
||||||
docker push "$REGISTRY_IMAGE:migrate-$REVISION" | tee "$RUNNER_TEMP/buzz-migration-push.log"
|
docker push "$REGISTRY_IMAGE:migrate-$REVISION" | tee "$RUNNER_TEMP/buzz-migration-push.log"
|
||||||
- name: Set up kubectl
|
- name: Set up kubectl
|
||||||
|
|||||||
Reference in New Issue
Block a user