Files
docker-cli/scripts/build/plugins
Ian Campbell 5db336798c Add some simple e2e tests for executing CLI plugins
To help with this add a bad plugin which produces invalid metadata and arrange
for it to be built in the e2e container.

Signed-off-by: Ian Campbell <ijc@docker.com>
2019-01-30 13:44:05 +00:00

22 lines
478 B
Bash
Executable File

#!/usr/bin/env bash
#
# Build a static binary for the host OS/ARCH
#
set -eu -o pipefail
source ./scripts/build/.variables
mkdir -p "build/plugins-${GOOS}-${GOARCH}"
for p in cli-plugins/examples/* "$@" ; do
[ -d "$p" ] || continue
n=$(basename "$p")
TARGET="build/plugins-${GOOS}-${GOARCH}/docker-${n}"
echo "Building statically linked $TARGET"
export CGO_ENABLED=0
go build -o "${TARGET}" --ldflags "${LDFLAGS}" "github.com/docker/cli/${p}"
done