-
Notifications
You must be signed in to change notification settings - Fork 270
Expand file tree
/
Copy pathcns.sh
More file actions
23 lines (19 loc) · 813 Bytes
/
cns.sh
File metadata and controls
23 lines (19 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -eux
[[ $OS =~ windows ]] && FILE_EXT='.exe' || FILE_EXT=''
export CGO_ENABLED=0
# Go 1.26 on Linux: systemcrypto is default but requires CGO; use nocgo backend instead
[[ ! $OS =~ windows ]] && export GOEXPERIMENT=ms_nocgo_opensslcrypto
mkdir -p "$OUT_DIR"/files
mkdir -p "$OUT_DIR"/bin
mkdir -p "$OUT_DIR"/scripts
pushd "$REPO_ROOT"/cns
GOOS="$OS" go build -v -a \
-o "$OUT_DIR"/bin/azure-cns"$FILE_EXT" \
-ldflags "-s -w -X main.version="$CNS_VERSION" -X "$CNS_AI_PATH"="$CNS_AI_ID"" \
-gcflags="-dwarflocationlists=true" \
service/*.go
cp kubeconfigtemplate.yaml "$OUT_DIR"/files/kubeconfigtemplate.yaml
cp configuration/cns_config.json "$OUT_DIR"/files/cns_config.json
cp ../npm/examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/scripts/setkubeconfigpath.ps1
popd