wwwwwwww
This commit is contained in:
parent
187841ba12
commit
79d41a9020
4 changed files with 10 additions and 14 deletions
|
@ -32,7 +32,7 @@ steps:
|
||||||
image: kokuwaio/buildctl:v0.21.0
|
image: kokuwaio/buildctl:v0.21.0
|
||||||
settings:
|
settings:
|
||||||
<<: *settings
|
<<: *settings
|
||||||
names:
|
name:
|
||||||
- registry.kokuwa.io/buildctl:latest
|
- registry.kokuwa.io/buildctl:latest
|
||||||
- registry.kokuwa.io/buildctl:v0.21.0
|
- registry.kokuwa.io/buildctl:v0.21.0
|
||||||
- docker.io/kokuwaio/buildctl:latest
|
- docker.io/kokuwaio/buildctl:latest
|
||||||
|
|
|
@ -7,7 +7,6 @@ steps:
|
||||||
|
|
||||||
renovate:
|
renovate:
|
||||||
image: kokuwaio/renovate-config-validator
|
image: kokuwaio/renovate-config-validator
|
||||||
pull: true
|
|
||||||
depends_on: []
|
depends_on: []
|
||||||
when: [path: [.woodpecker/lint.yaml, renovate.json]]
|
when: [path: [.woodpecker/lint.yaml, renovate.json]]
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
FROM docker.io/library/bash:5.2.37@sha256:01a15c6f48f6a3c08431cd77e11567823530b18159889dca3b7309b707beef91
|
FROM docker.io/library/bash:5.2.37@sha256:01a15c6f48f6a3c08431cd77e11567823530b18159889dca3b7309b707beef91
|
||||||
SHELL ["/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
|
SHELL ["/usr/local/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
|
||||||
# ignore pipefail because
|
# ignore pipefail because
|
||||||
# bash is non-default location https://github.com/tianon/docker-bash/issues/29
|
# bash is non-default location https://github.com/tianon/docker-bash/issues/29
|
||||||
# hadolint only uses default locations https://github.com/hadolint/hadolint/issues/977
|
# hadolint only uses default locations https://github.com/hadolint/hadolint/issues/977
|
||||||
|
|
|
@ -6,11 +6,6 @@ env | sort | grep -v DRONE
|
||||||
## check input
|
## check input
|
||||||
##
|
##
|
||||||
|
|
||||||
BUILDKIT_HOST=${PLUGIN_ADDR:-${BUILDKIT_HOST:-}}
|
|
||||||
if [[ -z "${BUILDKIT_HOST:-}" ]]; then
|
|
||||||
echo "Missing buildkit addr."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
BUILDCTL_CONTEXT=${PLUGIN_CONTEXT:-$(pwd)}
|
BUILDCTL_CONTEXT=${PLUGIN_CONTEXT:-$(pwd)}
|
||||||
BUILDCTL_DOCKERFILE=$(dirname "${PLUGIN_DOCKERFILE:-$BUILDCTL_CONTEXT/Dockerfile}")
|
BUILDCTL_DOCKERFILE=$(dirname "${PLUGIN_DOCKERFILE:-$BUILDCTL_CONTEXT/Dockerfile}")
|
||||||
if [[ ! -f $BUILDCTL_DOCKERFILE/Dockerfile ]]; then
|
if [[ ! -f $BUILDCTL_DOCKERFILE/Dockerfile ]]; then
|
||||||
|
@ -22,15 +17,16 @@ if [[ "$BUILDCTL_FRONTEND" != "dockerfile.v0" ]]; then
|
||||||
echo "Only frontend 'dockerfile.v0' testet and supported yet."
|
echo "Only frontend 'dockerfile.v0' testet and supported yet."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
SOURCE_DATE_EPOCH=${PLUGIN_SOURCE_DATE_EPOCH:-0}
|
||||||
SOURCE_DATE_EPOCH=${PLUGIN_SOURCE_DATE_EPOCH:-${SOURCE_DATE_EPOCH:-0}}
|
|
||||||
|
|
||||||
##
|
##
|
||||||
## build command
|
## build command
|
||||||
##
|
##
|
||||||
|
|
||||||
COMMAND="buildctl"
|
COMMAND="buildctl"
|
||||||
COMMAND="$COMMAND --addr $BUILDKIT_HOST"
|
if [[ -n "${PLUGIN_ADDR:-}" ]]; then
|
||||||
|
COMMAND="$COMMAND --addr $PLUGIN_ADDR"
|
||||||
|
fi
|
||||||
COMMAND="$COMMAND build"
|
COMMAND="$COMMAND build"
|
||||||
COMMAND="$COMMAND --frontend $BUILDCTL_FRONTEND"
|
COMMAND="$COMMAND --frontend $BUILDCTL_FRONTEND"
|
||||||
COMMAND="$COMMAND --local context='$BUILDCTL_CONTEXT'"
|
COMMAND="$COMMAND --local context='$BUILDCTL_CONTEXT'"
|
||||||
|
@ -39,11 +35,11 @@ if [[ "${PLUGIN_PLATFORM:-}" == "true" ]]; then
|
||||||
COMMAND="$COMMAND --opt platform='$PLUGIN_PLATFORM'"
|
COMMAND="$COMMAND --opt platform='$PLUGIN_PLATFORM'"
|
||||||
fi
|
fi
|
||||||
# https://github.com/moby/buildkit/blob/master/README.md#output
|
# https://github.com/moby/buildkit/blob/master/README.md#output
|
||||||
if [[ -n "${PLUGIN_NAMES:-}" ]]; then
|
if [[ -n "${PLUGIN_NAME:-}" ]]; then
|
||||||
COMMAND="$COMMAND --output type=image,name=$PLUGIN_NAMES,push=${PLUGIN_PUSH:-true}"
|
COMMAND="$COMMAND --output type=image,name=$PLUGIN_NAMES,push=${PLUGIN_PUSH:-true}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# custom args, e.g. docker run --rm --volume=$(pwd):$(pwd) --workdir=$(pwd) --env=CI=test kokuwaio/buildkit --opt buildarg=foo=bar
|
# custom args, e.g. docker run --rm --volume=$HOME:HOME:ro --workdir=$PWD kokuwaio/buildkit --opt buildarg=foo=bar
|
||||||
if [[ -n "${1:-}" ]]; then
|
if [[ -n "${1:-}" ]]; then
|
||||||
COMMAND="$COMMAND $*"
|
COMMAND="$COMMAND $*"
|
||||||
fi
|
fi
|
||||||
|
@ -52,5 +48,6 @@ fi
|
||||||
## execute command
|
## execute command
|
||||||
##
|
##
|
||||||
|
|
||||||
echo -e "${COMMAND// --/\\n --}\n"
|
echo -e "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH ${COMMAND// --/\\n --}\n"
|
||||||
eval "$COMMAND"
|
eval "$COMMAND"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue