Skip to content

Commit 6fbc7a6

Browse files
committed
chore(pack-images): add codename build-arg
1 parent 9dbb50b commit 6fbc7a6

15 files changed

Lines changed: 39 additions & 34 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
22
*.iml
33
.tools
4+
build.toml.*.*
5+
buildpacks/*/buildpack.toml

.woodpecker/build-linux-buildpacks.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ pipeline:
2424
- sed -i "s/{{CODENAME}}/$${CODENAME}/g" builder.toml
2525
- export PACK_HOME=$CI_WORKSPACE
2626
- make publish-buildpack
27-
environment:
28-
CODENAME: bookworm
2927
secrets:
28+
- codename
3029
- dev_registry
3130
- drycc_registry
3231
- container_username

.woodpecker/build-linux-pack.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ pipeline:
1313
image: bash
1414
commands:
1515
- echo $CONTAINER_PASSWORD | docker login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
16-
- CODENAME=bookworm make publish-pack
16+
- make publish-pack
1717
secrets:
18+
- codename
1819
- dev_registry
1920
- drycc_registry
2021
- container_username

.woodpecker/manifest-buildpacks.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ pipeline:
88
image: bash
99
commands:
1010
- sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest-buildpacks.tmpl
11-
- sed -i "s/{{codename}}/bookworm/g" .woodpecker/manifest-buildpacks.tmpl
12-
environment:
13-
CODENAME: bookworm
11+
- sed -i "s/{{codename}}/$${CODENAME}/g" .woodpecker/manifest-buildpacks.tmpl
1412
secrets:
13+
- codename
1514
- dev_registry
1615
- drycc_registry
1716
- container_username

.woodpecker/manifest-pack.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ pipeline:
1111
- sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest-build.tmpl
1212
- sed -i "s/{{codename}}/$${CODENAME}/g" .woodpecker/manifest-run.tmpl
1313
- sed -i "s/{{codename}}/$${CODENAME}/g" .woodpecker/manifest-build.tmpl
14-
environment:
15-
CODENAME: bookworm
1614
secrets:
15+
- codename
1716
- dev_registry
1817
- drycc_registry
1918
- container_username

.woodpecker/test-linux.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ pipeline:
1212
- name: test-linux
1313
image: bash
1414
commands:
15-
- CODENAME=$${CODENAME} make test-style
16-
environment:
17-
CODENAME: bookworm
15+
- make test-style
1816
secrets:
17+
- codename
1918
- dev_registry
2019
- codecov_token
2120
- drycc_registry

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# If DRYCC_REGISTRY is not set, try to populate it from legacy DEV_REGISTRY
2-
CODENAME ?= bookworm
32
DEV_REGISTRY ?= registry.drycc.cc
43
DRYCC_REGISTRY ?= ${DEV_REGISTRY}
54
PLATFORM ?= $(shell python3 _scripts/utils.py platform)
@@ -36,9 +35,16 @@ publish-pack: pack
3635
@docker push ${STACK_BUILD_IMAGE}
3736

3837
buildpack:
38+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/go/buildpack.tmpl buildpacks/go/buildpack.toml
39+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/java/buildpack.tmpl buildpacks/java/buildpack.toml
40+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/node/buildpack.tmpl buildpacks/node/buildpack.toml
41+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/php/buildpack.tmpl buildpacks/php/buildpack.toml
42+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/python/buildpack.tmpl buildpacks/python/buildpack.toml
43+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/ruby/buildpack.tmpl buildpacks/ruby/buildpack.toml
44+
STACK_ID=${STACK_ID} python3 _scripts/utils.py toml buildpacks/rust/buildpack.tmpl buildpacks/rust/buildpack.toml
3945
STACK_ID=${STACK_ID} LIFECYCLE_URL=${LIFECYCLE_URL} STACK_RUN_IMAGE=${STACK_RUN_IMAGE} STACK_BUILD_IMAGE=${STACK_BUILD_IMAGE} python3 _scripts/utils.py toml builder.toml builder.toml.${PLATFORM}.${ARCH}
4046
@pack builder create ${BUILDPACKS_IMAGE} --config builder.toml.${PLATFORM}.${ARCH} --pull-policy if-not-present
41-
@rm -rf builder.toml.${PLATFORM}.${ARCH}
47+
@rm -rf builder.toml.${PLATFORM}.${ARCH} buildpacks/*/buildpack.toml
4248

4349
publish-buildpack: buildpack
4450
@docker push ${BUILDPACKS_IMAGE}

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ This repository is responsible for building and publishing images that builds
66
with [Cloud Native Buildpacks'](https://buildpacks.io)
77
[`pack`](https://github.com/buildpacks/pack) command.
88

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

1414
## Usage
1515

16-
`pack build myapp --builder drycc/buildpacks:bookworm`
16+
`pack build myapp --builder drycc/buildpacks:codename`
1717

1818
## System
1919

2020
The basic image is based on Debian system, See the table below for system description:
2121

2222
STACK ID | Buildpacks image | Operating System
2323
----------------|---------------------------------------------|---------------------------------
24-
drycc-bookworm | registry.drycc.cc/drycc/buildpacks:bookworm | Debian 11 bookworm
24+
drycc-codename | registry.drycc.cc/drycc/buildpacks:codename | Debian 11 codename
2525

2626
The basic layer of buildpack supports custom software sources and custom software.
2727
For example, if we use alicloud to install libpq-dev, we can add `.deb-list` and `·source-list` files to the project.
2828

2929
```
3030
cat > ".source-list" <<EOL
31-
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm main non-free contrib
32-
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm main non-free contrib
33-
deb http://mirrors.cloud.aliyuncs.com/debian-security bookworm/updates main
34-
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bookworm/updates main
35-
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm-updates main non-free contrib
36-
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm-updates main non-free contrib
37-
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm-backports main non-free contrib
38-
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm-backports main non-free contrib
31+
deb http://mirrors.cloud.aliyuncs.com/debian/ codename main non-free contrib
32+
deb-src http://mirrors.cloud.aliyuncs.com/debian/ codename main non-free contrib
33+
deb http://mirrors.cloud.aliyuncs.com/debian-security codename/updates main
34+
deb-src http://mirrors.cloud.aliyuncs.com/debian-security codename/updates main
35+
deb http://mirrors.cloud.aliyuncs.com/debian/ codename-updates main non-free contrib
36+
deb-src http://mirrors.cloud.aliyuncs.com/debian/ codename-updates main non-free contrib
37+
deb http://mirrors.cloud.aliyuncs.com/debian/ codename-backports main non-free contrib
38+
deb-src http://mirrors.cloud.aliyuncs.com/debian/ codename-backports main non-free contrib
3939
EOL
4040
4141
cat > ".deb-list" <<EOL
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ homepage = "https://github.com/drycc/pack-images/tree/main/buildpacks/go"
1010

1111
# Stacks that the buildpack will work with
1212
[[stacks]]
13-
id = "drycc-bookworm"
13+
id = "{STACK_ID}"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ homepage = "https://github.com/drycc/pack-images/tree/main/buildpacks/java"
1010

1111
# Stacks that the buildpack will work with
1212
[[stacks]]
13-
id = "drycc-bookworm"
13+
id = "{STACK_ID}"

0 commit comments

Comments
 (0)