-
Notifications
You must be signed in to change notification settings - Fork 75
/
.drone.yml
200 lines (177 loc) · 4.07 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
kind: pipeline
type: docker
name: izpbx-release
environment:
APP_VER: "${DRONE_TAG}"
APP_VER_BUILD: "${DRONE_BUILD_NUMBER}"
APP_BUILD_COMMIT: "${DRONE_COMMIT_SHA:0:7}"
APP_BUILD_DATE: "${DRONE_BUILD_FINISHED}"
trigger:
event:
- tag
concurrency:
limit: 1
volumes:
- name: cache
host:
path: /var/cache/drone/${DRONE_REPO}/${DRONE_STAGE_NAME}
workspace:
base: /drone
path: src
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- /drone/docker
- name: print-env
image: alpine/git
commands:
- set
- name: build-docker
#image: owncloudci/drone-docker-buildx
image: plugins/docker
privileged: true
settings:
repo: izdock/izpbx-asterisk
dockerfile: izpbx-asterisk/Dockerfile
context: izpbx-asterisk
build_args_from_env:
- APP_VER
- APP_VER_BUILD
- APP_BUILD_COMMIT
- APP_BUILD_DATE
storage_path: /drone/docker
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
tags:
- latest
- ${DRONE_TAG}
- ${DRONE_TAG%.*}
- ${DRONE_TAG%%.*}
- ${DRONE_TAG}-${DRONE_BUILD_NUMBER}
#- ${DRONE_COMMIT_SHA:0:7}
platforms:
- linux/amd64
# - linux/arm64
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- /drone/docker
- name: notify
image: spotlightkid/drone-matrixchat-notify
settings:
homeserver: https://quantico.in
roomid: "!UCuIdxzWsiiboEXriU:quantico.in"
userid: "@gitbot:quantico.in"
password:
from_secret: MATRIX_PASSWORD
markdown: 'yes'
template: |
[`${DRONE_REPO}`](${DRONE_BUILD_LINK}) build:[`#${DRONE_BUILD_NUMBER}`] tag:[`${DRONE_TAG}`] status:[**${DRONE_BUILD_STATUS}**]
---
kind: pipeline
type: docker
name: izpbx-dev-amd64
environment:
APP_VER: dev-20.16
RHEL_VER: 8
PHP_VER: 7.4
ASTERISK_VER: 20.8.1
FREEPBX_VER: 16
APP_DEBUG: 1
APP_VER_BUILD: "${DRONE_BUILD_NUMBER}"
APP_BUILD_COMMIT: "${DRONE_COMMIT_SHA:0:7}"
APP_BUILD_DATE: "${DRONE_BUILD_FINISHED}"
trigger:
event:
- push
branch:
- dev
platform:
os: linux
arch: amd64
concurrency:
limit: 1
volumes:
- name: cache
host:
path: /var/cache/drone/${DRONE_REPO}/${DRONE_STAGE_NAME}
workspace:
base: /drone
path: src
steps:
- name: restore-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
restore: true
mount:
- /drone/docker
- name: print-env
image: alpine/git
commands:
- set
- name: prep
image: alpine
commands:
- echo -e -n "dev-$${ASTERISK_VER%%.*}.$${FREEPBX_VER}" >> .tags
# - echo -e -n ",$${DRONE_COMMIT_SHA:0:7}" >> .tags
# - echo -e -n ",dev-$${ASTERISK_VER%.*}" >> .tags
# - echo -e -n ",dev-$${ASTERISK_VER}" >> .tags
# - echo -e -n ",dev-$${ASTERISK_VER}-$${DRONE_BUILD_NUMBER}" >> .tags
# - echo -e -n ",dev-$${ASTERISK_VER}-$${DRONE_COMMIT_SHA:0:7}" >> .tags
- name: build-docker
image: plugins/docker
settings:
repo: izdock/izpbx-asterisk
dockerfile: izpbx-asterisk/Dockerfile
context: izpbx-asterisk
build_args_from_env:
- APP_VER
- APP_VER_BUILD
- APP_BUILD_COMMIT
- APP_BUILD_DATE
- APP_DEBUG
- RHEL_VER
- PHP_VER
- ASTERISK_VER
- FREEPBX_VER
storage_path: /drone/docker
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
- name: rebuild-cache
image: drillster/drone-volume-cache
volumes:
- name: cache
path: /cache
settings:
rebuild: true
mount:
- /drone/docker
- name: notify
image: spotlightkid/drone-matrixchat-notify
settings:
homeserver: https://quantico.in
roomid: "!UCuIdxzWsiiboEXriU:quantico.in"
userid: "@gitbot:quantico.in"
password:
from_secret: MATRIX_PASSWORD
markdown: 'yes'
template: |
[`${DRONE_REPO}`](${DRONE_BUILD_LINK}) build:[`#${DRONE_BUILD_NUMBER}`] tag:[`${DRONE_TAG}`] status:[**${DRONE_BUILD_STATUS}**]