2018-12-10 10:30:19 -05:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
2021-11-17 11:18:15 -05:00
|
|
|
# Build plugins examples for the host OS/ARCH
|
2018-12-10 10:30:19 -05:00
|
|
|
#
|
|
|
|
|
|
|
|
set -eu -o pipefail
|
|
|
|
|
|
|
|
source ./scripts/build/.variables
|
|
|
|
|
2018-12-11 09:15:04 -05:00
|
|
|
for p in cli-plugins/examples/* "$@" ; do
|
2018-12-10 10:30:19 -05:00
|
|
|
[ -d "$p" ] || continue
|
|
|
|
|
|
|
|
n=$(basename "$p")
|
2021-11-17 11:18:15 -05:00
|
|
|
TARGET_PLUGIN="$(dirname "${TARGET}")/plugins-${GOOS}-${GOARCH}/docker-${n}"
|
|
|
|
mkdir -p "$(dirname "${TARGET_PLUGIN}")"
|
2018-12-10 10:30:19 -05:00
|
|
|
|
2021-11-17 11:18:15 -05:00
|
|
|
echo "Building $GO_LINKMODE $(basename "${TARGET_PLUGIN}")"
|
|
|
|
(set -x ; CGO_ENABLED=0 GO111MODULE=auto go build -o "${TARGET_PLUGIN}" -tags "${GO_BUILDTAGS}" -ldflags "${LDFLAGS}" ${GO_BUILDMODE} "github.com/docker/cli/${p}")
|
2018-12-10 10:30:19 -05:00
|
|
|
done
|