forked from tezedge/tezedge-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
160 lines (142 loc) · 3.82 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
kind: pipeline
name: development-ci
type: docker
steps:
- name: build #build the frontend docker image
image: docker:latest
commands:
- docker build --no-cache --build-arg branch=${DRONE_BRANCH} -t drone-tezedge-explorer:latest -f Dockerfile .
volumes:
- name: docker_sock
path: /var/run/docker.sock
- name: frontend-server
image: drone-tezedge-explorer:latest
pull: if-not-exists
detach: true
privileged: true
environment:
SANDBOX: 'https://${DRONE_BRANCH}.dev.tezedge.com:3030'
API: '[{"id":"${DRONE_BRANCH}","name":"${DRONE_BRANCH}.dev.tezedge","http":"http://${DRONE_BRANCH}.dev.tezedge.com:18732","monitoring":"http://${DRONE_BRANCH}.dev.tezedge.com:38732/resources/tezedge","debugger":"http://${DRONE_BRANCH}.dev.tezedge.com:17732","ws":false}]'
depends_on:
- build
- name: test
image: cypress/included:6.2.1
environment:
CYPRESS_baseUrl: http://frontend-server:80
depends_on:
- frontend-server
- name: publish
image: plugins/docker
when:
branch:
- develop
depends_on:
- test
settings:
repo: simplestakingcom/tezedge-explorer
tags: latest
dockerfile: Dockerfile
build_args:
- branch=develop
- commit=${DRONE_COMMIT}
username:
from_secret: docker_hub_username
password:
from_secret: docker_hub_pswd
image_pull_secrets:
- docker_pull_secret
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
trigger:
branch:
- develop
- master # same process, without the publish step
event: push
---
kind: pipeline
name: deployment-ci
type: docker
steps:
- name: build #build the frontend docker image
image: docker:latest
commands:
- docker build --no-cache --build-arg branch=master -t drone-tezedge-explorer:latest -f Dockerfile .
volumes:
- name: docker_sock
path: /var/run/docker.sock
# - name: frontend-server #detach it to access it inside test step
# image: drone-tezedge-explorer:latest
# pull: if-not-exists
# detach: true
# privileged: true
# environment:
# SANDBOX: 'https://master.dev.tezedge.com:3030'
# API: '[{"id":"master","name":"master.dev.tezedge","http":"http://master.dev.tezedge.com:18732","monitoring":"http://master.dev.tezedge.com:38732/resources/tezedge","debugger":"http://master.dev.tezedge.com:17732","ws":false}]'
# depends_on:
# - build
# - name: test
# image: cypress/included:6.2.1
# environment:
# CYPRESS_baseUrl: http://frontend-server:80
# depends_on:
# - frontend-server
# - name: publish
# image: plugins/docker
# depends_on:
# - test
# settings:
# repo: simplestakingcom/tezedge-explorer
# tags:
# - ${DRONE_TAG}
# - latest-release
# dockerfile: Dockerfile
# build_args:
# - branch=master
# - commit=${DRONE_COMMIT}
# username:
# from_secret: docker_hub_username
# password:
# from_secret: docker_hub_pswd
- name: cp-static
image: drone-tezedge-explorer:latest
depends_on:
# TODO
- build
# - test
privileged: true
pull: if-not-exists
volumes:
- name: static_page
path: /etc/static_page
commands:
- cp -R /usr/share/nginx/html/* /etc/static_page
- name: publish-firebase
image: devillex/docker-firebase
pull: if-not-exists
volumes:
- name: static_page
path: /drone/src/dist/tezedge-explorer
environment:
FIREBASE_API_TOKEN:
from_secret: FIREBASE_API_TOKEN
depends_on:
# TODO
- cp-static
# - test
# - publish
commands:
- firebase deploy --token=$${FIREBASE_API_TOKEN}
image_pull_secrets:
- docker_pull_secret
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
- name: static_page
host:
path: /etc/tezedge-ci/tezedge-explorer/
trigger:
ref: refs/tags/**
event: tag