-
Notifications
You must be signed in to change notification settings - Fork 270
Expand file tree
/
Copy pathnpm.sh
More file actions
24 lines (19 loc) · 865 Bytes
/
npm.sh
File metadata and controls
24 lines (19 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/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"/npm
GOOS="$OS" go build -a -v -trimpath \
-o "$OUT_DIR"/bin/azure-npm"$FILE_EXT" \
-ldflags "-s -w -X main.version="$NPM_VERSION" -X "$NPM_AI_PATH"="$NPM_AI_ID"" \
-gcflags="-dwarflocationlists=true" \
./cmd/*.go
cp ./examples/windows/kubeconfigtemplate.yaml "$OUT_DIR"/files/kubeconfigtemplate.yaml
cp ./examples/windows/setkubeconfigpath.ps1 "$OUT_DIR"/scripts/setkubeconfigpath.ps1
cp ./examples/windows/setkubeconfigpath-capz.ps1 "$OUT_DIR"/scripts/setkubeconfigpath-capz.ps1
popd