-
Notifications
You must be signed in to change notification settings - Fork 253
/
Copy path.drone.yml
199 lines (170 loc) · 4.61 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
kind: pipeline
type: docker
name: block_duplicated_pr_merged
steps:
- name: current_hollaex_kit_version
image: alpine
commands:
- export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags_current
- echo "Current Release tag is :" && cat .tags_current
- name: previous_hollaex_kit_version
image: byrnedo/alpine-curl
commands:
- curl https://raw.githubusercontent.com/bitholla/hollaex-kit/master/version > .tags_previous
- echo "The previous master release tag is :" && cat .tags_previous
- name: version_comparison
image: frolvlad/alpine-bash
commands:
- export TAGS_CURRENT=$(cat .tags_current) && export TAGS_PREVIOUS=$(cat .tags_previous) && if [ "$TAGS_PREVIOUS" == "$TAGS_CURRENT" ]; then echo "Blocking the merge since the versions are same..." && exit 1; else echo "hi"; fi
- name: slack_noti_job_end
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
when:
status: [failure]
trigger:
branch:
- master
event:
- pull_request
---
kind: pipeline
type: docker
name: slack_notify
steps:
- name: partymaker_version_tag_testnet
image: alpine
commands:
- cat version > .tags
- echo "Current version tag is :" && cat .tags
when:
branch: master
- name: partymaker_version_tag
image: alpine
commands:
- echo "$(cat version)-testnet" > .tags
- echo "Current version tag is :" && cat .tags
when:
branch: testnet
- name: create_github_release
image: bitholla/devops-tools:drone_github_hub-2004241546
environment:
GITHUB_TOKEN:
from_secret: github_oauth2_token_for_releases
commands:
- apt-get update && apt-get install -y hub git
- hub release create -m "HollaEx Kit v$(cat .tags) Release" -t ${DRONE_BRANCH} $(cat .tags)
when:
branch: master
- name: slack_noti_to_releases
image: bitholla/devops-tools:drone_partymaker-0.1.4
environment:
WEBHOOK_URL:
from_secret: webhook_url
when:
status: [success]
- name: notify_to_discord_releases
image: bitholla/devops-tools:drone_partymaker-0.1.5
channel: deployment
settings:
target: discord
release_name: hollaex-kit
environment:
WEBHOOK_URL:
from_secret: discord_webhook_url
when:
status: [ success, failure ]
branch: master
trigger:
branch:
- master
- testnet
event:
- push
---
kind: pipeline
type: docker
name: kit_v2_sandbox_deployment
steps:
- name: slack_noti_job_start
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: "<{{build.link}}|HollaEx v2 Sandbox Deployment> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
- name: partymaker_version_tag
image: alpine
commands:
- echo "$(cat version)-sandbox" > .tags
- echo "Current version tag is :" && cat .tags
- name: request_hollacloud_to_run_upgrade
image: bitholla/devops-tools:drone_hollacloud-220216
environment:
HOLLAEX_EMAIL:
from_secret: hollaex_email
HOLLAEX_PASSWORD:
from_secret: hollaex_password
HOLLAEX_LOGIN_KEY:
from_secret: hollaex_network_testnet_login_key
settings:
exchange_id: 176
exchange_name: "Sandbox HollaEx"
- name: slack_noti_job_end
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
when:
status: [success, failure]
trigger:
branch:
- testnet
event:
- push
---
kind: pipeline
type: docker
name: kit_v2_next_deployment
steps:
- name: slack_noti_job_start
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
template: "<{{build.link}}|HollaEx v2 Next Test Exchange Deployment> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
- name: partymaker_version_tag
image: alpine
commands:
- echo "$(cat version)-next" > .tags
- echo "Current version tag is :" && cat .tags
- name: request_hollacloud_to_run_upgrade
image: bitholla/devops-tools:drone_hollacloud-220216
environment:
HOLLAEX_EMAIL:
from_secret: next_email
HOLLAEX_PASSWORD:
from_secret: next_password
HOLLAEX_LOGIN_KEY:
from_secret: hollaex_network_testnet_login_key
settings:
exchange_id: 539
exchange_name: "Next"
kit_branch: "next"
- name: slack_noti_job_end
image: plugins/slack
settings:
channel: deployment
webhook:
from_secret: slack_webhook
when:
status: [success, failure]
trigger:
branch:
- next
event:
- push