Skip to content

Commit

Permalink
Merge pull request #469 from gravitl/feature_v0.9.0_binaries
Browse files Browse the repository at this point in the history
binary builder script
  • Loading branch information
afeiszli committed Nov 17, 2021
2 parents c0927b6 + 55e51da commit 9e58722
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ netmaker-arm64
netmaker-32
netmaker-amd64
netclient/netclient
netclient/build
netclient/build/
netclient/files/netclient
netclient/netclient-amd64
netclient/netclient-arm
Expand Down
21 changes: 10 additions & 11 deletions netclient/ncutils/netclientutils_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import (

// RunCmd - runs a local command
func RunCmd(command string, printerr bool) (string, error) {
args := strings.Fields(command)
cmd := exec.Command(args[0], args[1:]...)
cmd.Wait()
out, err := cmd.CombinedOutput()
if err != nil && printerr {
log.Println("error running command:", command)
log.Println(strings.TrimSuffix(string(out), "\n"))
}
return string(out), err
}
turn string(out), err
args := strings.Fields(command)
cmd := exec.Command(args[0], args[1:]...)
cmd.Wait()
out, err := cmd.CombinedOutput()
if err != nil && printerr {
log.Println("error running command:", command)
log.Println(strings.TrimSuffix(string(out), "\n"))
}
return string(out), err
}

14 changes: 14 additions & 0 deletions scripts/build-binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
cd netclient
env GOOS=linux GOARCH=amd64 go build -o build/netclient main.go
env GOOS=linux GOARCH=arm GOARM=5 go build -o build/netclient-arm5 main.go
env GOOS=linux GOARCH=arm GOARM=6 go build -o build/netclient-arm6 main.go
env GOOS=linux GOARCH=arm GOARM=7 go build -o build/netclient-arm7 main.go
env GOOS=linux GOARCH=arm64 go build -o build/netclient-arm64 main.go
env GOOS=linux GOARCH=mipsle go build -ldflags "-s -w" -o build/netclient-mipsle main.go && upx build/netclient-mipsle
env GOOS=freebsd GOARCH=amd64 go build -o build/netclient-freebsd main.go
env GOOS=freebsd GOARCH=arm GOARM=5 go build -o build/netclient-freebsd-arm5 main.go
env GOOS=freebsd GOARCH=arm GOARM=6 go build -o build/netclient-freebsd-arm6 main.go
env GOOS=freebsd GOARCH=arm GOARM=7 go build -o build/netclient-freebsd-arm7 main.go
env GOOS=freebsd GOARCH=arm64 go build -o build/netclient-freebsd-arm64 main.go
env GOOS=darwin GOARCH=amd64 go build -o build/netclient-darwmin main.go
5 changes: 4 additions & 1 deletion scripts/netclient-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ case $(uname | tr '[:upper:]' '[:lower:]') in
;;
arm*)
dist=netclient-$CPU_ARCH
;;
;;
mipsle)
dist=netclient-mipsle
;;
*)
fatal "$CPU_ARCH : cpu architecture not supported"
esac
Expand Down

0 comments on commit 9e58722

Please sign in to comment.