Skip to content

Commit 8ca86c3

Browse files
committed
chore(CICD): use drone
1 parent ec0739e commit 8ca86c3

4 files changed

Lines changed: 168 additions & 13 deletions

File tree

.drone/drone.yml

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 $DRYCC_REGISTRY --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 $DRYCC_REGISTRY --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/drycc/go-dev
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/database/values.yaml
136+
- helm package charts/database --version ${DRONE_TAG:-v1.0.0}
137+
- curl -u $CHARTMUSEUM_USERNAME:$CHARTMUSEUM_PASSWORD -F chart=@database-${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

.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/postgres:{{#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/postgres:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
11+
platform:
12+
architecture: amd64
13+
os: linux
14+
-
15+
image: docker.io/drycc/postgres:{{#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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
# Drycc Postgres
3-
4-
[![Build Status](https://travis-ci.org/drycc/postgres.svg?branch=main)](https://travis-ci.org/drycc/postgres)
3+
[![Build Status](https://drone.drycc.cc/api/badges/drycc/postgres/status.svg)](https://drone.drycc.cc/drycc/postgres)
54

65
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.
76

0 commit comments

Comments
 (0)