This repository has been archived on 2024-10-30. You can view files and clone it, but cannot push or open issues or pull requests.
concourse-buildkit/entrypoint.sh

47 lines
741 B
Bash
Executable file

#!/usr/bin/env sh
fail() {
echo "Error:" "$@" 1>&2
exit 1
}
echo_and_run() {
echo "$@"
"$@"
}
plain() {
buildctl-daemonless.sh "$@"
}
build() {
if [ -z "$dest" ]; then
fail "missing argument: dest"
fi
if [ -z "$context" ]; then
context=.
fi
if [ -z "$platform" ]; then
platform=""
else
platform="--opt platform=$platform"
fi
echo_and_run buildctl-daemonless.sh \
build \
--frontend dockerfile.v0 \
--local context="$context" \
--local dockerfile="$context" \
$platform \
--output type=oci,dest="$dest"
}
if [ -z "$manual" ]; then
manual=false
fi
if "$manual"; then
plain "$@"
else
build
fi