11#! /bin/bash
22set -eux
33
4+ [[ $OS =~ windows ]] && FILE_EXT=' exe' || FILE_EXT=' bin'
5+
46mkdir -p " $OUT_DIR " /files
57mkdir -p " $OUT_DIR " /bin
68
@@ -12,7 +14,7 @@ export CGO_ENABLED=0
1214CNI_NET_DIR=" $REPO_ROOT " /cni/network/plugin
1315pushd " $CNI_NET_DIR "
1416 go build -v -a -trimpath \
15- -o " $OUT_DIR " /bin/azure-vnet.exe \
17+ -o " $OUT_DIR " /bin/azure-vnet." $FILE_EXT " \
1618 -ldflags " -X main.version=" $CNI_VERSION " " \
1719 -gcflags=" -dwarflocationlists=true" \
1820 ./main.go
2123STATELESS_CNI_BUILD_DIR=" $REPO_ROOT " /cni/network/stateless
2224pushd " $STATELESS_CNI_BUILD_DIR "
2325 go build -v -a -trimpath \
24- -o " $OUT_DIR " /bin/azure-vnet-stateless.exe \
26+ -o " $OUT_DIR " /bin/azure-vnet-stateless." $FILE_EXT " \
2527 -ldflags " -X main.version=" $CNI_VERSION " " \
2628 -gcflags=" -dwarflocationlists=true" \
2729 ./main.go
3032CNI_IPAM_DIR=" $REPO_ROOT " /cni/ipam/plugin
3133pushd " $CNI_IPAM_DIR "
3234 go build -v -a -trimpath \
33- -o " $OUT_DIR " /bin/azure-vnet-ipam.exe \
35+ -o " $OUT_DIR " /bin/azure-vnet-ipam." $FILE_EXT " \
3436 -ldflags " -X main.version=" $CNI_VERSION " " \
3537 -gcflags=" -dwarflocationlists=true" \
3638 ./main.go
3941CNI_IPAMV6_DIR=" $REPO_ROOT " /cni/ipam/pluginv6
4042pushd " $CNI_IPAMV6_DIR "
4143 go build -v -a -trimpath \
42- -o " $OUT_DIR " /bin/azure-vnet-ipamv6.exe \
44+ -o " $OUT_DIR " /bin/azure-vnet-ipamv6." $FILE_EXT " \
4345 -ldflags " -X main.version=" $CNI_VERSION " " \
4446 -gcflags=" -dwarflocationlists=true" \
4547 ./main.go
4850CNI_TELEMETRY_DIR=" $REPO_ROOT " /cni/telemetry/service
4951pushd " $CNI_TELEMETRY_DIR "
5052 go build -v -a -trimpath \
51- -o " $OUT_DIR " /bin/azure-vnet-telemetry.exe \
53+ -o " $OUT_DIR " /bin/azure-vnet-telemetry." $FILE_EXT " \
5254 -ldflags " -X main.version=" $CNI_VERSION " -X " $CNI_AI_PATH " =" $CNI_AI_ID " " \
5355 -gcflags=" -dwarflocationlists=true" \
5456 ./telemetrymain.go
0 commit comments