-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.drone.yml
59 lines (52 loc) · 1.34 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
54
55
56
57
58
59
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a proprietary
# license that can be found in the LICENSE file.
kind: pipeline
type: docker
name: release
trigger:
branch:
- main
event:
- cron
- push
steps:
- name: build-and-push
image: docker:24.0.6-dind-alpine3.18
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}:0.46.1 -t $${image_name}:latest .
- docker push $${image_name}:$${full_date_tag}
- docker push $${image_name}:0.46.1
- docker push $${image_name}:latest
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
---
kind: pipeline
type: docker
name: example
trigger:
branch:
- main
event:
- cron
- push
steps:
- name: scan
image: quay.io/sighup/trivy-offline:latest
pull: always
commands:
- trivy image --skip-update python:3.12-alpine