Skip to content

Commit eb3ac26

Browse files
author
lijianguo
committed
chore(drone): modify drone
1 parent 78e7d70 commit eb3ac26

12 files changed

Lines changed: 62 additions & 61 deletions

File tree

.drone/drone.yml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ platform:
99
steps:
1010
- name: test
1111
image: docker.io/drycc/go-dev
12-
pull: if-not-exists
12+
pull: always
1313
privileged: true
1414
commands:
1515
- STACK=20 make test-style
@@ -29,9 +29,9 @@ steps:
2929
- name: image_registries
3030
path: /etc/containers/registries.conf
3131

32-
- name: publish-pack
32+
- name: publish pack
3333
image: docker.io/drycc/go-dev
34-
pull: if-not-exists
34+
pull: always
3535
privileged: true
3636
commands:
3737
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
@@ -74,9 +74,9 @@ platform:
7474
os: linux
7575

7676
steps:
77-
- name: publish
77+
- name: publish pack
7878
image: docker.io/drycc/go-dev
79-
pull: if-not-exists
79+
pull: always
8080
privileged: true
8181
commands:
8282
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
@@ -105,20 +105,22 @@ type: docker
105105
name: manifest-pack
106106

107107
steps:
108-
- name: generate manifest
108+
- name: generate pack manifest
109109
image: docker.io/library/alpine
110-
pull: if-not-exists
111110
commands:
112-
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest.tmpl
111+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest-run.tmpl
113112
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest-build.tmpl
113+
- sed -i "s/20/$${STACK}/g" .drone/manifest-run.tmpl
114+
- sed -i "s/20/$${STACK}/g" .drone/manifest-build.tmpl
114115
environment:
116+
STACK: 20
115117
DRYCC_REGISTRY:
116118
from_secret: drycc_registry
117119

118-
- name: publish-20
120+
- name: publish run
119121
image: plugins/manifest
120122
settings:
121-
spec: .drone/manifest.tmpl
123+
spec: .drone/manifest-run.tmpl
122124
username:
123125
from_secret: docker_username
124126
password:
@@ -130,7 +132,7 @@ steps:
130132
DRYCC_REGISTRY:
131133
from_secret: drycc_registry
132134

133-
- name: publish-20-build
135+
- name: publish build
134136
image: plugins/manifest
135137
settings:
136138
spec: .drone/manifest-build.tmpl
@@ -157,19 +159,20 @@ depends_on:
157159
---
158160
kind: pipeline
159161
type: docker
160-
name: linux-buildpacks-arm64
162+
name: linux-buildpacks-amd64
161163

162164
platform:
163165
arch: amd64
164166
os: linux
165167

166168
steps:
167-
- name: publish
169+
- name: publish amd64 buildpack
168170
image: docker.io/drycc/go-dev
169-
pull: if-not-exists
171+
pull: always
170172
privileged: true
171173
commands:
172174
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
175+
- docker system service --time 0 unix:///var/run/docker.sock &
173176
- STACK=20 VERSION=20-linux-amd64 make publish-buildpack
174177
environment:
175178
DEV_REGISTRY:
@@ -202,12 +205,13 @@ platform:
202205
os: linux
203206

204207
steps:
205-
- name: publish
208+
- name: publish arm64 buildpack
206209
image: docker.io/drycc/go-dev
207-
pull: if-not-exists
210+
pull: always
208211
privileged: true
209212
commands:
210213
- echo $DOCKER_PASSWORD | docker login $DRYCC_REGISTRY --username $DOCKER_USERNAME --password-stdin
214+
- docker system service --time 0 unix:///var/run/docker.sock &
211215
- STACK=20 VERSION=20-linux-arm64 make publish-buildpack
212216
environment:
213217
DEV_REGISTRY:
@@ -236,17 +240,19 @@ type: docker
236240
name: manifest-buildpacks
237241

238242
steps:
239-
- name: generate manifest
243+
- name: generate buildpacks manifest
240244
image: docker.io/library/alpine
241-
pull: if-not-exists
242245
commands:
243246
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" .drone/manifest-buildpacks.tmpl
244-
- sed -i "s/docker.io/${DRYCC_REGISTRY}/g" builder.toml
247+
- sed -i "s/docker.io/$${DRYCC_REGISTRY}/g" builder.toml
248+
- sed -i "s/20/$${STACK}/g" .drone/manifest-buildpacks.tmpl
249+
- sed -i "s/20/$${STACK}/g" builder.toml
245250
environment:
251+
STACK: 20
246252
DRYCC_REGISTRY:
247253
from_secret: drycc_registry
248254

249-
- name: publish-20-buildpacks
255+
- name: publish buildpack
250256
image: plugins/manifest
251257
settings:
252258
spec: .drone/manifest-buildpacks.tmpl

.drone/manifest-build.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
image: docker.io/drycc/pack:${STACK}-build
1+
image: docker.io/drycc/pack:20-build
22
manifests:
33
-
4-
image: docker.io/drycc/pack:${STACK}-linux-amd64-build
4+
image: docker.io/drycc/pack:20-linux-amd64-build
55
platform:
66
architecture: amd64
77
os: linux
88
-
9-
image: docker.io/drycc/pack:${STACK}-linux-arm64-build
9+
image: docker.io/drycc/pack:20-linux-arm64-build
1010
platform:
1111
architecture: arm64
1212
os: linux

.drone/manifest-buildpacks.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
image: docker.io/drycc/buildpacks:${STACK}
1+
image: docker.io/drycc/buildpacks:20
22
manifests:
33
-
4-
image: docker.io/drycc/buildpacks:${STACK}-linux-amd64
4+
image: docker.io/drycc/buildpacks:20-linux-amd64
55
platform:
66
architecture: amd64
77
os: linux
88
-
9-
image: docker.io/drycc/buildpacks:${STACK}-linux-arm64
9+
image: docker.io/drycc/buildpacks:20-linux-arm64
1010
platform:
1111
architecture: arm64
1212
os: linux

.drone/manifest-run.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
image: docker.io/drycc/pack:20
2+
manifests:
3+
-
4+
image: docker.io/drycc/pack:20-linux-amd64
5+
platform:
6+
architecture: amd64
7+
os: linux
8+
-
9+
image: docker.io/drycc/pack:20-linux-arm64
10+
platform:
11+
architecture: arm64
12+
os: linux

.drone/manifest.tmpl

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

Dockerfile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ADD rootfs /
99
RUN groupadd drycc --gid ${pack_gid} && \
1010
useradd drycc -u ${pack_uid} -g ${pack_gid} -s /bin/bash -m
1111
RUN mkdir /app && \
12-
chown drycc:drycc /app /usr/src /var/lib
12+
chown drycc:drycc /app
1313
RUN chmod +x /usr/local/bin/* && \
1414
install-tools.sh
1515

Dockerfile.run

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ ARG pack_uid=1000
77
ARG pack_gid=1000
88

99
RUN groupadd drycc --gid ${pack_gid} && \
10-
useradd drycc -u ${pack_uid} -g ${pack_gid} -s /bin/bash -m && \
11-
chown drycc:drycc /usr/src /var/lib
12-
13-
RUN apt-get update && apt-get install autoconf -y
10+
useradd drycc -u ${pack_uid} -g ${pack_gid} -s /bin/bash -m
1411

1512
ARG STACK
1613
LABEL io.buildpacks.stack.id="${STACK}"

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ SHELL_SCRIPTS = $(shell find "buildpacks" -name '*.sh') $(shell find "rootfs" -n
1010
SHELL=/bin/bash -o pipefail
1111

1212
pack:
13-
@docker build --pull -f Dockerfile.build --build-arg STACK=drycc-${STACK} --build-arg BASE_IMAGE=registry.uucin.com/lijianguo/stack-images:${STACK}-build -t registry.uucin.com/lijianguo/pack:${VERSION}-build .
14-
@docker build --pull -f Dockerfile.run --build-arg STACK=drycc-${STACK} --build-arg BASE_IMAGE=registry.uucin.com/lijianguo/stack-images:${STACK} -t registry.uucin.com/lijianguo/pack:${VERSION} .
13+
@docker build --pull -f Dockerfile.build --build-arg STACK=drycc-${STACK} --build-arg BASE_IMAGE=${DRYCC_REGISTRY}/drycc/stack-images:${STACK}-build -t ${DRYCC_REGISTRY}/drycc/pack:${VERSION}-build .
14+
@docker build --pull -f Dockerfile.run --build-arg STACK=drycc-${STACK} --build-arg BASE_IMAGE=${DRYCC_REGISTRY}/drycc/stack-images:${STACK} -t ${DRYCC_REGISTRY}/drycc/pack:${VERSION} .
1515

1616
publish-pack: pack
17-
@docker push registry.uucin.com/lijianguo/stack-images:${VERSION}-build
18-
@docker push registry.uucin.com/lijianguo/stack-images:${VERSION}
17+
@docker push ${DRYCC_REGISTRY}/drycc/pack:${VERSION}-build
18+
@docker push ${DRYCC_REGISTRY}/drycc/pack:${VERSION}
1919

2020
buildpack:
21-
@pack builder create registry.uucin.com/lijianguo/buildpacks:${VERSION} --config builder.toml --pull-policy if-not-present
21+
@pack builder create ${DRYCC_REGISTRY}/drycc/buildpacks:${VERSION} --config builder.toml --pull-policy if-not-present
2222

2323
publish-buildpack: buildpack
24-
@docker push registry.uucin.com/lijianguo/buildpacks:${VERSION}
24+
@docker push ${DRYCC_REGISTRY}/drycc/buildpacks:${VERSION}
2525

2626
publish: publish-pack publish-buildpack
2727

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ with [Cloud Native Buildpacks'](https://buildpacks.io)
77
[`pack`](https://github.com/buildpacks/pack) command.
88

99
* [drycc/pack:20](https://hub.docker.com/r/drycc/pack/tags/) - A CNB
10-
compatible run image based on drycc:20
10+
compatible run image based on drycc/pack:20
1111
* [drycc/pack:20-build](https://hub.docker.com/r/drycc/pack/tags/) - A CNB
12-
compatible build image based on drycc:20-build
12+
compatible build image based on drycc/pack:20-build
1313

1414
## Usage
1515

16-
`pack build myapp --builder drycc/buildpacks:18`
16+
`pack build myapp --builder drycc/buildpacks:20`

builder.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
description = "Base builder for 20 stack, based on ubuntu:20.04 base image"
22

33
[lifecycle]
4-
# version = "0.11.3"
5-
uri = "https://kubernetes-release.uucin.com/drycc/lifecycle-v0.11.3%2Blinux.x86-64.tgz"
4+
version = "0.11.3"
65

76
[[buildpacks]]
87
id = "drycc/ruby"
@@ -14,7 +13,6 @@ uri = "https://kubernetes-release.uucin.com/drycc/lifecycle-v0.11.3%2Blinux.x86-
1413
id = "drycc/ruby"
1514
version = "0.0.1"
1615

17-
1816
[[buildpacks]]
1917
id = "drycc/python"
2018
version = "0.0.1"
@@ -25,7 +23,6 @@ version = "0.0.1"
2523
id = "drycc/python"
2624
version = "0.0.1"
2725

28-
2926
[[buildpacks]]
3027
id = "drycc/go"
3128
version = "0.0.1"
@@ -36,6 +33,7 @@ version = "0.0.1"
3633
id = "drycc/go"
3734
version = "0.0.1"
3835

36+
3937
[[buildpacks]]
4038
id = "drycc/nodejs"
4139
version = "0.0.1"
@@ -46,6 +44,7 @@ version = "0.0.1"
4644
id = "drycc/nodejs"
4745
version = "0.0.1"
4846

47+
4948
[[buildpacks]]
5049
id = "drycc/rust"
5150
version = "0.0.1"
@@ -78,5 +77,5 @@ version = "0.0.1"
7877

7978
[stack]
8079
id = "drycc-20"
81-
build-image = "registry.uucin.com/lijianguo/pack:20-build"
82-
run-image = "registry.uucin.com/lijianguo/pack:20"
80+
build-image = "docker.io/drycc/pack:20-build"
81+
run-image = "docker.io/drycc/pack:20"

0 commit comments

Comments
 (0)