Skip to content

Commit 8aacefd

Browse files
author
lijianguo
committed
chore(CICD): use drone
1 parent 53fd658 commit 8aacefd

4 files changed

Lines changed: 170 additions & 12 deletions

File tree

.drone/drone.yml

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

.drone/manifest.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
image: docker.io/drycc/controller:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}}
2+
{{#if build.tags}}
3+
tags:
4+
{{#each build.tags}}
5+
- {{this}}
6+
{{/each}}
7+
{{/if}}
8+
manifests:
9+
-
10+
image: docker.io/drycc/controller:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
11+
platform:
12+
architecture: amd64
13+
os: linux
14+
-
15+
image: docker.io/drycc/controller:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64
16+
platform:
17+
architecture: arm64
18+
os: linux

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Drycc Controller
33

4-
[![Build Status](https://travis-ci.org/drycc/controller.svg?branch=main)](https://travis-ci.org/drycc/controller)
4+
[![Build Status](https://drone.drycc.cc/api/badges/drycc/controller/status.svg)](https://drone.drycc.cc/drycc/controller)
55
[![codecov.io](https://codecov.io/github/drycc/controller/coverage.svg?branch=main)](https://codecov.io/github/drycc/controller?branch=main)
66

77
Drycc (pronounced DAY-iss) Workflow is an open source Platform as a Service (PaaS) that adds a developer-friendly layer to any [Kubernetes](http://kubernetes.io) cluster, making it easy to deploy and manage applications on your own servers.

0 commit comments

Comments
 (0)