Skip to content

Commit a938d9f

Browse files
段洪义duanhongyi
authored andcommitted
chore(drone): fix config bug
1 parent c621da5 commit a938d9f

3 files changed

Lines changed: 51 additions & 41 deletions

File tree

.drone/drone.yml

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,41 @@ platform:
77
os: linux
88

99
steps:
10-
- name: test
11-
image: docker.io/library/docker:dind
12-
privileged: true
13-
commands:
14-
- nohup dockerd &
15-
- apk add make bash curl
16-
- make test
17-
environment:
18-
DEV_REGISTRY:
19-
from_secret: dev_registry
10+
- name: test
11+
image: docker.io/library/docker:dind
12+
privileged: true
13+
commands:
14+
- nohup dockerd &
15+
- apk add make bash curl
16+
- make test
17+
environment:
18+
DEV_REGISTRY:
19+
from_secret: dev_registry
20+
DOCKER_USERNAME:
21+
from_secret: docker_username
22+
DOCKER_PASSWORD:
23+
from_secret: docker_password
2024

21-
- name: publish
22-
image: docker.io/library/docker:dind
23-
privileged: true
24-
commands:
25-
- nohup dockerd &
26-
- apk add make bash curl
27-
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
28-
- make build push
29-
environment:
30-
DEV_REGISTRY:
31-
from_secret: dev_registry
32-
when:
33-
event:
34-
- push
35-
- tag
25+
- name: publish
26+
image: docker.io/library/docker:dind
27+
privileged: true
28+
commands:
29+
- nohup dockerd &
30+
- apk add make bash curl
31+
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
32+
- make build push
33+
environment:
34+
VERSION: ${DRONE_TAG:-latest}-linux-amd64
35+
DEV_REGISTRY:
36+
from_secret: dev_registry
37+
DOCKER_USERNAME:
38+
from_secret: docker_username
39+
DOCKER_PASSWORD:
40+
from_secret: docker_password
41+
when:
42+
event:
43+
- push
44+
- tag
3645

3746
---
3847
kind: pipeline
@@ -48,9 +57,9 @@ steps:
4857
image: docker.io/library/docker:dind
4958
privileged: true
5059
commands:
51-
- nohup dockerd &
52-
- apk add make bash curl
53-
- make test
60+
- nohup dockerd &
61+
- apk add make bash curl
62+
- make test
5463
environment:
5564
DEV_REGISTRY:
5665
from_secret: dev_registry
@@ -59,11 +68,12 @@ steps:
5968
image: docker.io/library/docker:dind
6069
privileged: true
6170
commands:
62-
- nohup dockerd &
63-
- apk add make bash curl
64-
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
65-
- make build push
71+
- nohup dockerd &
72+
- apk add make bash curl
73+
- echo $DOCKER_PASSWORD | docker login --username $DOCKER_USERNAME --password-stdin
74+
- make build push
6675
environment:
76+
VERSION: ${DRONE_TAG:-latest}-linux-arm64
6777
DEV_REGISTRY:
6878
from_secret: dev_registry
6979
DOCKER_USERNAME:
@@ -75,16 +85,16 @@ steps:
7585
- push
7686
- tag
7787

78-
-
79-
nd: pipeline
88+
---
89+
kind: pipeline
8090
type: docker
8191
name: manifest
8292

8393
steps:
8494
- name: manifest
8595
image: docker.io/library/alpine
8696
commands:
87-
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" ./drone/manifest.tmpl
97+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
8898
environment:
8999
DRYCC_REGISTRY:
90100
from_secret: drycc_registry

.drone/manifest.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: docker.io/drycc/registry:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
1+
image: docker.io/drycc/go-dev:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
22
{{#if build.tags}}
33
tags:
44
{{#each build.tags}}
@@ -7,12 +7,12 @@ tags:
77
{{/if}}
88
manifests:
99
-
10-
image: docker.io/drycc/registry:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest-{{/if}}linux-amd64
10+
image: docker.io/drycc/go-dev:{{#if build.tag}}{{build.tag}}{{else}}latest-{{/if}}linux-amd64
1111
platform:
1212
architecture: amd64
1313
os: linux
1414
-
15-
image: docker.io/drycc/registry:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest-{{/if}}linux-arm64
15+
image: docker.io/drycc/go-dev:{{#if build.tag}}{{build.tag}}{{else}}latest-{{/if}}linux-arm64
1616
platform:
1717
architecture: arm64
1818
os: linux

rootfs/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \
1111
&& apt-get update \
1212
&& apt-get install -y lsb-release \
1313
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
14-
&& curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
15-
&& echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list \
1614
&& echo "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee -a /etc/apt/sources.list.d/docker.list \
1715
&& apt-get update \
1816
&& apt-get upgrade -y --no-install-recommends \
@@ -41,8 +39,10 @@ RUN export DEBIAN_FRONTEND=noninteractive \
4139
zip \
4240
shellcheck \
4341
etcd \
44-
kubectl \
4542
docker-ce-cli \
43+
&& curl -o /usr/local/bin/kubectl \
44+
-L "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(dpkg --print-architecture)/kubectl" \
45+
&& chmod +x /usr/local/bin/kubectl \
4646
&& go env -w GO111MODULE=on \
4747
&& go get -u -v \
4848
github.com/AlekSi/gocov-xml \

0 commit comments

Comments
 (0)