-
Notifications
You must be signed in to change notification settings - Fork 19
/
.drone.yml
198 lines (181 loc) · 4.85 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
kind: pipeline
type: docker
name: unit tests
steps:
- name: go vet and unit tests
image: golang:1.19
commands:
- go vet ./...
- go test -cover ./...
- go build -o release/linux/amd64/lite-engine
volumes:
- name: cache
path: /go
depends_on:
- clone
- name: golangci-lint
image: golangci/golangci-lint:v1.51.2
commands:
- golangci-lint run --timeout 360s
volumes:
- name: cache
path: /go
depends_on:
- clone
volumes:
- name: cache
temp: {}
---
kind: pipeline
type: vm
name: ubuntu acceptance tests
pool:
use: ubuntu
steps:
- name: build
image: golang:1.19
commands:
- go build -o lite-engine
- name: server
detach: true
commands:
- touch .env
- echo "SERVER_HTTPS_BIND=localhost:9000" >> .env
- echo "CLIENT_HTTPS_BIND=localhost:9000" >> .env
- echo "SERVER_INSECURE=true" >> .env
- echo "CLIENT_INSECURE=true" >> .env
- echo "DEBUG=true" >> .env
- echo "TRACE=true" >> .env
- ./lite-engine server --env-file=".env"
depends_on:
- build
- name: client
commands:
- sleep 5
- cat .env
- while ! curl -sf http://localhost:9000/healthz; do sleep 1; done
- ./lite-engine client --env-file=".env"
depends_on:
- server
# ---
# kind: pipeline
# type: vm
# name: osx acceptance tests
# pool:
# use: anka-arm64
# steps:
# - name: install_go
# commands:
# - brew install golang
# - go build -o lite-engine
# - name: server
# detach: true
# commands:
# - touch .env
# - echo "SERVER_HTTPS_BIND=localhost:9000" >> .env
# - echo "CLIENT_HTTPS_BIND=localhost:9000" >> .env
# - echo "SERVER_INSECURE=true" >> .env
# - echo "CLIENT_INSECURE=true" >> .env
# - echo "DEBUG=true" >> .env
# - echo "TRACE=true" >> .env
# - ./lite-engine server --env-file=".env"
# depends_on:
# - install_go
# - name: client
# commands:
# - sleep 5
# - cat .env
# - while ! curl -sf http://localhost:9000/healthz; do sleep 1; done
# - ./lite-engine client --env-file=".env"
# depends_on:
# - server
---
kind: pipeline
type: vm
name: arm64 ubuntu acceptance tests
pool:
use: ubuntu_arm64
steps:
- name: build
image: golang:1.19
commands:
- go build -o lite-engine
- name: server
detach: true
commands:
- touch .env
- echo "SERVER_HTTPS_BIND=localhost:9000" >> .env
- echo "CLIENT_HTTPS_BIND=localhost:9000" >> .env
- echo "SERVER_INSECURE=true" >> .env
- echo "CLIENT_INSECURE=true" >> .env
- echo "DEBUG=true" >> .env
- echo "TRACE=true" >> .env
- ./lite-engine server --env-file=".env"
depends_on:
- build
- name: client
commands:
- sleep 5
- cat .env
- while ! curl -sf http://localhost:9000/healthz; do sleep 1; done
- ./lite-engine client --env-file=".env"
depends_on:
- server
---
kind: pipeline
type: vm
name: windows acceptance tests
pool:
use: windows
steps:
- name: build
image: golang:1.19
commands:
- go build -o lite-engine.exe
- name: server
detach: true
commands:
- echo "SERVER_HTTPS_BIND=localhost:9000" >> .env
- echo "CLIENT_HTTPS_BIND=localhost:9000" >> .env
- echo "SERVER_INSECURE=true" >> .env
- echo "CLIENT_INSECURE=true" >> .env
- echo "DEBUG=true" >> .env
- echo "TRACE=true" >> .env
- (Get-Content ".env") | Set-Content ".env"
- .\lite-engine.exe server --env-file=".env"
depends_on:
- build
- name: client
commands:
- sleep 10
- cat .env
- .\lite-engine.exe client --env-file=".env"
depends_on:
- server
---
kind: pipeline
type: docker
name: release artifacts
steps:
- name: build
image: golang:1.19
commands:
- GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/lite-engine-linux-amd64
- GOOS=linux GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/lite-engine-linux-arm64
- GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/lite-engine-darwin-amd64
- GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/lite-engine-darwin-arm64
- GOOS=windows GOARCH=amd64 go build -ldflags "-s -w -X main.version=${DRONE_TAG##v}" -o release/lite-engine-windows-amd64.exe
- name: release
image: plugins/github-release
settings:
files:
- release/lite-engine-linux-amd64
- release/lite-engine-linux-arm64
- release/lite-engine-darwin-amd64
- release/lite-engine-darwin-arm64
- release/lite-engine-windows-amd64.exe
api_key:
from_secret: github_token
trigger:
event:
- tag