-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.drone.yml
More file actions
149 lines (137 loc) · 2.9 KB
/
.drone.yml
File metadata and controls
149 lines (137 loc) · 2.9 KB
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
kind: secret
name: username
get:
path: caesar-team/data/registry
name: username
---
kind: secret
name: password
get:
path: caesar-team/data/registry
name: password
---
kind: secret
name: repository
get:
path: caesar-team/data/registry
name: repo-ci-test-php
---
kind: secret
name: registry
get:
path: secret/data/registry
name: registry
---
kind: secret
name: notifications
get:
path: secret/data/notifications-4xxi
name: caesar-builds
---
kind: secret
name: notification_username
get:
path: secret/data/notifications-4xxi
name: username
---
kind: secret
name: notification_icon
get:
path: secret/data/notifications-4xxi
name: icon_url
---
kind: secret
name: dockerconfig
get:
path: secret/data/docker
name: config.json
---
kind: pipeline
type: docker
name: 4xxi
image_pull_secrets:
- dockerconfig
globals:
- &confNoSaveBuild
dockerfile: Dockerfile
repo: plugins/docker
tag: fourxxi
dry_run: true
daemon_off: false
- &confSaveBuild
dockerfile: Dockerfile
repo:
from_secret: repository
tag: ${DRONE_BRANCH}
username:
from_secret: username
password:
from_secret: password
- &stepCheckBuild
name: build test
image: plugins/docker
settings:
<<: *confNoSaveBuild
- &stepMainBuild
name: build
image: plugins/docker
settings:
<<: *confSaveBuild
- &stepTagBuild
image: plugins/docker
settings:
auto_tag: true
<<: *confSaveBuild
- &stepNotifyToSlack
name: notify-to-slack
image: plugins/slack
pull: always
settings:
webhook:
from_secret: notifications
channel: caesar-builds
username:
from_secret: notification_username
icon_url:
from_secret: notification_icon
template: >
{{#success build.status}}
*Event*: `{{build.event}}` {{build.status}}
*Repository*: `{{repo.name}}` to `{{build.branch}}`
*Commit*: `{{build.commit}}`
*Info*: {{build.number}} build was started {{since build.created}} and executed for {{since build.started}}
<{{build.link}}|*Build link*>
{{else}}
*Event*: `{{build.event}}` {{build.status}}
*Repository*: `{{repo.name}}` to `{{build.branch}}`
*Commit*: `{{build.commit}}`
*Info*: {{build.number}} build was started {{since build.created}} and executed for {{since build.started}}
<{{build.link}}|*Build link*>
{{/success}}
steps:
- <<: *stepCheckBuild
when:
branch: [feature/*, hotfix/*]
event: [push]
- <<: *stepMainBuild
when:
branch: [develop, main]
event: [push]
- name: build tag
<<: *stepTagBuild
when:
branch: [main]
event: [tag]
- <<: *stepNotifyToSlack
when:
status: [success, failure]
branch: [develop, main]
trigger:
branch:
- main
- develop
- feature/*
- hotfix/*
event:
- tag
- push