Browse Source

test-trivy

pull/28/head
fedy95 4 years ago
parent
commit
6588798639
  1. 21
      .drone.yml

21
.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