-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
169 lines (152 loc) · 3.46 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
---
kind: pipeline
type: docker
name: container
platform:
os: linux
arch: amd64
steps:
- name: build
image: golang:1.20
commands:
- make build
environment:
SRC: github.com/docker/distribution
- name: executable
image: alpine
commands:
- src/bin/registry --help
- src/bin/registry --version
depends_on:
- build
- name: security-build
image: docker.io/owncloudci/drone-docker-buildx:4
settings:
dockerfile: Dockerfile
output: type=oci,dest=oci/${DRONE_REPO_NAME},tar=false
repo: owncloudops/${DRONE_REPO_NAME}
depends_on:
- executable
- name: security-scan
image: ghcr.io/aquasecurity/trivy
commands:
- trivy -v
- trivy image --input oci/${DRONE_REPO_NAME}
environment:
TRIVY_EXIT_CODE: 1
TRIVY_IGNORE_UNFIXED: True
TRIVY_NO_PROGRESS: True
TRIVY_SEVERITY: HIGH,CRITICAL
TRIVY_TIMEOUT: 1m
TRIVY_SKIP_FILES: /usr/local/bin/gomplate
depends_on:
- security-build
- name: changelog
image: quay.io/thegeeklab/git-chglog
commands:
- git fetch -tq
- git-chglog --no-color --no-emoji -o CHANGELOG.md ${DRONE_TAG:---next-tag unreleased unreleased}
- cat CHANGELOG.md
depends_on:
- security-scan
- name: publish-dockerhub
image: docker.io/owncloudci/drone-docker-buildx:4
settings:
dockerfile: Dockerfile
auto_tag: True
password:
from_secret: docker_password
repo: owncloudops/${DRONE_REPO_NAME}
username:
from_secret: docker_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- changelog
- name: publish-quay
image: docker.io/owncloudci/drone-docker-buildx:4
settings:
dockerfile: Dockerfile
auto_tag: True
password:
from_secret: quay_password
registry: quay.io
repo: quay.io/owncloudops/${DRONE_REPO_NAME}
username:
from_secret: quay_username
when:
ref:
- refs/heads/main
- refs/tags/**
depends_on:
- changelog
- name: release
image: docker.io/plugins/github-release
settings:
api_key:
from_secret: github_token
note: CHANGELOG.md
overwrite: true
title: ${DRONE_TAG}
when:
ref:
- refs/tags/**
depends_on:
- publish-dockerhub
- publish-quay
trigger:
ref:
- refs/heads/main
- refs/tags/**
- refs/pull/**
---
kind: pipeline
type: docker
name: notifications
platform:
os: linux
arch: amd64
steps:
- name: pushrm-dockerhub
image: docker.io/chko/docker-pushrm:1
environment:
DOCKER_PASS:
from_secret: docker_password
DOCKER_USER:
from_secret: docker_username
PUSHRM_FILE: README.md
PUSHRM_TARGET: owncloudops/${DRONE_REPO_NAME}
when:
status:
- success
- name: pushrm-quay
image: docker.io/chko/docker-pushrm:1
environment:
APIKEY__QUAY_IO:
from_secret: quay_token
PUSHRM_FILE: README.md
PUSHRM_TARGET: quay.io/owncloudops/${DRONE_REPO_NAME}
when:
status:
- success
- name: notify
image: docker.io/plugins/slack
settings:
channel:
from_secret: rocketchat_chat_channel
webhook:
from_secret: rocketchat_chat_webhook
when:
status:
- failure
trigger:
ref:
- refs/heads/main
- refs/tags/**
status:
- success
- failure
depends_on:
- container