-
Notifications
You must be signed in to change notification settings - Fork 2
/
.drone.yml
167 lines (167 loc) · 3.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
---
kind: pipeline
type: kubernetes
name: docker
concurrency:
limit: 1
trigger:
branch:
- main
event:
- push
metadata:
namespace: git
steps:
- name: Fetch tags
image: alpine/git
commands:
- git fetch --tags
- name: Build site
image: node:current
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-docker
NODE_CONFIG_ENV: default
commands:
- apt update && apt install -y git
- yarn install
- yarn build
- name: build docker image
image: docker
privileged: true
volumes:
- name: cache
path: /cache
environment:
TOKEN:
from_secret: docker_hub
commands:
- dockerd &
- docker login -u voidic -p $TOKEN
- docker buildx create --name mybuilder --bootstrap --use
- docker buildx build -t voidic/snort:latest --platform linux/amd64,linux/arm64 --push -f Dockerfile.prebuilt .
- kill $(cat /var/run/docker.pid)
volumes:
- name: cache
claim:
name: docker-cache
---
kind: pipeline
type: kubernetes
name: test-lint
concurrency:
limit: 1
metadata:
namespace: git
steps:
- name: Test/Lint
image: node:current
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-test
NODE_CONFIG_ENV: default
commands:
- yarn install
- yarn build
- yarn test
- yarn workspace @snort/app eslint
- yarn prettier --check .
volumes:
- name: cache
claim:
name: docker-cache
---
kind: pipeline
type: kubernetes
name: crowdin
concurrency:
limit: 1
trigger:
branch:
- main
event:
- push
metadata:
namespace: git
steps:
- name: Push/Pull translations
image: node:current
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-translations
NODE_CONFIG_ENV: default
TOKEN:
from_secret: gitea
CTOKEN:
from_secret: crowdin
commands:
- git config --global user.email [email protected]
- git config --global user.name "Drone CI"
- git remote set-url origin https://drone:[email protected]/Kieran/snort.git
- yarn install
- npx @crowdin/cli upload sources -b main -T $CTOKEN
- npx @crowdin/cli pull -b main -T $CTOKEN
- yarn prettier --write .
- git add .
- >
if output=$(git status --porcelain) && [ -n "$output" ]; then
git commit -a -m "chore: Update translations"
git push -u origin main
fi
volumes:
- name: cache
claim:
name: docker-cache
---
kind: pipeline
type: kubernetes
name: docker-release
concurrency:
limit: 1
trigger:
event:
- tag
metadata:
namespace: git
steps:
- name: Fetch tags
image: alpine/git
commands:
- git fetch --tags
- name: Build site
image: node:current
volumes:
- name: cache
path: /cache
environment:
YARN_CACHE_FOLDER: /cache/.yarn-docker-
NODE_CONFIG_ENV: default
commands:
- apt update && apt install -y git
- yarn install
- yarn build
- name: build docker image
image: docker
privileged: true
volumes:
- name: cache
path: /cache
environment:
TOKEN:
from_secret: docker_hub
commands:
- dockerd &
- docker login -u voidic -p $TOKEN
- docker buildx create --name mybuilder --bootstrap --use
- docker buildx build -t voidic/snort:$DRONE_TAG --platform linux/amd64,linux/arm64 --push -f Dockerfile.prebuilt .
- kill $(cat /var/run/docker.pid)
volumes:
- name: cache
claim:
name: docker-cache