Skip to content

Commit f7d1548

Browse files
lijianguoduanhongyi
authored andcommitted
chore(CICD): pretty .drone.yaml format
1 parent 38db617 commit f7d1548

2 files changed

Lines changed: 149 additions & 155 deletions

File tree

.drone/.drone.yml

Lines changed: 0 additions & 155 deletions
This file was deleted.

.drone/drone.yaml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
kind: pipeline
2+
type: docker
3+
name: linux-amd64
4+
5+
platform:
6+
arch: amd64
7+
os: linux
8+
9+
steps:
10+
- name: test
11+
image: docker.io/drycc/go-dev
12+
pull: if-not-exists
13+
privileged: true
14+
commands:
15+
- make docker-build test
16+
environment:
17+
VERSION: ${DRONE_TAG:-latest}-linux-amd64
18+
DEV_REGISTRY: ${DEV_REGISTRY:-docker.io}
19+
DRYCC_REGISTRY: ${DRYCC_REGISTRY:-docker.io}
20+
when:
21+
event:
22+
- push
23+
- tag
24+
- pull_request
25+
26+
- name: publish
27+
image: docker.io/drycc/go-dev
28+
pull: if-not-exists
29+
privileged: true
30+
commands:
31+
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
32+
- make docker-build docker-immutable-push
33+
environment:
34+
VERSION: ${DRONE_TAG:-latest}-linux-amd64
35+
DEV_REGISTRY:
36+
from_secret: dev_registry
37+
DRYCC_REGISTRY:
38+
from_secret: drycc_registry
39+
DOCKER_USERNAME:
40+
from_secret: docker_username
41+
DOCKER_PASSWORD:
42+
from_secret: docker_password
43+
when:
44+
event:
45+
- push
46+
- tag
47+
48+
trigger:
49+
event:
50+
- push
51+
- tag
52+
- pull_request
53+
54+
---
55+
kind: pipeline
56+
type: docker
57+
name: linux-arm64
58+
59+
platform:
60+
arch: arm64
61+
os: linux
62+
63+
steps:
64+
- name: publish
65+
image: docker.io/drycc/go-dev
66+
pull: if-not-exists
67+
privileged: true
68+
commands:
69+
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
70+
- make docker-build docker-immutable-push
71+
environment:
72+
VERSION: ${DRONE_TAG:-latest}-linux-arm64
73+
DEV_REGISTRY:
74+
from_secret: dev_registry
75+
DRYCC_REGISTRY:
76+
from_secret: drycc_registry
77+
DOCKER_USERNAME:
78+
from_secret: docker_username
79+
DOCKER_PASSWORD:
80+
from_secret: docker_password
81+
82+
trigger:
83+
event:
84+
- push
85+
- tag
86+
87+
---
88+
kind: pipeline
89+
type: docker
90+
name: manifest
91+
92+
steps:
93+
- name: generate manifest
94+
image: docker.io/library/alpine
95+
pull: if-not-exists
96+
commands:
97+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
98+
environment:
99+
DRYCC_REGISTRY:
100+
from_secret: drycc_registry
101+
102+
- name: publish
103+
image: plugins/manifest
104+
settings:
105+
spec: .drone/manifest.tmpl
106+
username:
107+
from_secret: docker_username
108+
password:
109+
from_secret: docker_password
110+
environment:
111+
DEV_REGISTRY:
112+
from_secret: dev_registry
113+
DRYCC_REGISTRY:
114+
from_secret: drycc_registry
115+
116+
trigger:
117+
event:
118+
- push
119+
- tag
120+
121+
depends_on:
122+
- linux-amd64
123+
- linux-arm64
124+
125+
---
126+
kind: pipeline
127+
type: docker
128+
name: chart
129+
130+
steps:
131+
- name: generate chart
132+
image: docker.io/drycc/python-dev
133+
commands:
134+
- IMAGE_TAG=$([ ! -z $DRONE_TAG ] && echo ${DRONE_TAG:1} || echo \"canary\")
135+
- sed -i "s/image_tag:\ \"canary\"/image_tag:\ $IMAGE_TAG/g" charts/registry/values.yaml
136+
- helm package charts/registry --version ${DRONE_TAG:-v1.0.0}
137+
- curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@registry-${DRONE_TAG:-v1.0.0}.tgz "$CHARTMUSEUM_API/api/$([ -z $DRONE_TAG ] && echo testing |echo stable)/charts"
138+
environment:
139+
CHARTMUSEUM_USERNAME:
140+
from_secret: chartmuseum_username
141+
CHARTMUSEUM_PASSWORD:
142+
from_secret: chartmuseum_password
143+
CHARTMUSEUM_API:
144+
from_secret: chartmuseum_api
145+
146+
trigger:
147+
event:
148+
- push
149+
- tag

0 commit comments

Comments
 (0)