From 6588798639eeb267b240c53f07033c14151a670d Mon Sep 17 00:00:00 2001 From: fedy95 Date: Mon, 28 Jun 2021 18:54:51 +0300 Subject: [PATCH] test-trivy --- .drone.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index de54e44..9136ab5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,20 +17,31 @@ steps: when: event: pull_request + - name: build image + image: docker:dind + volumes: + - name: dockersock + path: /var/run/docker.sock + environment: + REGISTRY: registry.fedy95.com + commands: + - docker build -t "$REGISTRY"/baseimage-yamllint:$DRONE_COMMIT_SHA image -f image/Dockerfile + when: + event: pull_request + - name: trivy security check image: aquasec/trivy -# volumes: -# - name: dockersock -# path: /var/run/docker.sock + volumes: + - name: dockersock + path: /var/run/docker.sock environment: REGISTRY: registry.fedy95.com commands: - - docker build -t "$REGISTRY"/baseimage-yamllint:temp image -f image/Dockerfile - "trivy \ --exit-code 1 \ --format json \ --no-progress \ - $REGISTRY/baseimage-yamllint:temp" + $REGISTRY/baseimage-yamllint:$DRONE_COMMIT_SHA" when: event: pull_request