diff --git a/build/build_binary.sh b/build/build_binary.sh index b9fe6509c..24715d378 100755 --- a/build/build_binary.sh +++ b/build/build_binary.sh @@ -1,9 +1,14 @@ -binary="portainer" +set -x + mkdir -p dist -cd 'api/cmd/portainer' - +cd api +# the go get adds 8 seconds go get -t -d -v ./... -GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' -mv "${binary}" "../../../dist/portainer" \ No newline at end of file +# the build takes 2 seconds +GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \ + --installsuffix cgo \ + --ldflags '-s' \ + -o "../dist/portainer" \ + ./cmd/portainer/ diff --git a/package.json b/package.json index a67a7b332..ac1615932 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ "format": "prettier --loglevel warn --write \"**/*.{js,css,html}\"", "lint": "yarn lint:client; yarn lint:server", "lint:server": "cd api && golangci-lint run -E exportloopref", - "lint:client": "eslint --cache --fix ." + "lint:client": "eslint --cache --fix .", + "test:server": "cd api && go test ./..." }, "scriptsComments": { "build": "Build the entire app (backend/frontend) in development mode",