This commit is contained in:
parent
acc5cb167b
commit
53a486264f
3 changed files with 13 additions and 6 deletions
|
@ -1,14 +1,9 @@
|
|||
when:
|
||||
instance: ci.kokuwa.io
|
||||
repo: woodpecker/buildctl
|
||||
event: [manual, push, pull_request]
|
||||
branch: main
|
||||
path: [.woodpecker/build.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
|
||||
|
||||
steps:
|
||||
|
||||
build:
|
||||
image: kokuwaio/buildctl
|
||||
pull: true
|
||||
settings: &settings
|
||||
name: registry.kokuwa.io/kokuwaio/buildctl:ci-${CI_PIPELINE_NUMBER}
|
||||
auth:
|
||||
|
@ -16,6 +11,10 @@ steps:
|
|||
username: {from_secret: kokuwa_io_username}
|
||||
password: {from_secret: kokuwa_io_password}
|
||||
platform: [linux/amd64, linux/arm64]
|
||||
build-args:
|
||||
NPM_CONFIG_REGISTRY:
|
||||
FOO: bar
|
||||
CCC: null
|
||||
annotation:
|
||||
org.opencontainers.image.title: Buildctl WoodpeckerCI Plugin
|
||||
org.opencontainers.image.description: A WoodpeckerCI plugin for buildctl to build container images using a remote builtkitd instance.
|
||||
|
|
|
@ -31,6 +31,9 @@ steps:
|
|||
annotation:
|
||||
org.opencontainers.image.title: My Image
|
||||
org.opencontainers.image.description: A description.
|
||||
build-args:
|
||||
NPM_CONFIG_REGISTRY: # reused from ci env
|
||||
FOO: bar
|
||||
platform: [linux/amd64, linux/arm64]
|
||||
auth:
|
||||
registry.example.org:
|
||||
|
@ -75,6 +78,7 @@ docker run --rm --user=$(id -u) --volume=$HOME:$HOME:ro --workdir=$PWD --env=PLU
|
|||
| `frontend` | PLUGIN_FRONTEND | `dockerfile.v0` | Only dockerfile frontend supported right now |
|
||||
| `context` | PLUGIN_CONTEXT | `$PWD` | Context directory to use for build |
|
||||
| `dockerfile` | PLUGIN_DOCKERFILE | `Dockerfile` | Dockerfile to use. |
|
||||
| `build-args` | PLUGIN_BUILD_ARGS | `none` | Build args to pass to build |
|
||||
| `platform` | PLUGIN_PLATFORM | `none` | Target platform for container image. |
|
||||
| `source-epoch-date` | PLUGIN_SOURCE_DATE_EPOCH | `0` | Timestamp to use for reproduceable builds. |
|
||||
| `name` | PLUGIN_NAME | `none` | Images names where to push the image. |
|
||||
|
|
|
@ -37,6 +37,10 @@ fi
|
|||
COMMAND+=" --frontend=$BUILDCTL_FRONTEND"
|
||||
COMMAND+=" --local=context=$BUILDCTL_CONTEXT"
|
||||
COMMAND+=" --local=dockerfile=$BUILDCTL_DOCKERFILE"
|
||||
if [[ -n "${PLUGIN_BUILD_ARGS:-}" ]]; then
|
||||
env|sort
|
||||
OUTPUT+="$(echo "$PLUGIN_BUILD_ARGS" | jq --join-output 'keys[] as $k|",annotation.\($k)=\(.[$k])"')"
|
||||
fi
|
||||
if [[ -n "${PLUGIN_PLATFORM:-}" ]]; then
|
||||
COMMAND+=" --opt=platform=$PLUGIN_PLATFORM"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue