forked from sighupio/trivy-offline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
53 lines (47 loc) · 1.08 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
kind: pipeline
name: release
trigger:
branch:
- master
event:
- cron
- push
steps:
- name: build-and-push
image: docker:dind
pull: always
environment:
REGISTRY: quay.io
REGISTRY_USER:
from_secret: registry_user
REGISTRY_PASSWORD:
from_secret: registry_password
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- image_name=$${REGISTRY}/sighup/trivy-offline
- full_date_tag=$(date +"%Y-%m-%d")
- docker login $${REGISTRY} -u $${REGISTRY_USER} -p $${REGISTRY_PASSWORD}
- docker build --pull --no-cache -t $${image_name}:$${full_date_tag} -t $${image_name}:latest .
- docker push $${image_name}:$${full_date_tag}
- docker push $${image_name}:latest
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
kind: pipeline
name: example
trigger:
branch:
- master
event:
- cron
- push
steps:
- name: scan
image: quay.io/sighup/trivy-offline:latest
pull: always
commands:
- trivy image --skip-update python:3.4-alpine