chore(build): reduce the time to run yarn build:server from 1.5minutes, to 10 seconds (#5987)

* reduce the time to run yarn build:server from 1.5minutes, to 10 seconds

Signed-off-by: Sven Dowideit <sven.dowideit@portainer.io>

* add yarn test:server

Signed-off-by: Sven Dowideit <sven.dowideit@portainer.io>
pull/5997/head
Sven Dowideit 3 years ago committed by GitHub
parent 33001a8654
commit 76ced401f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,9 +1,14 @@
binary="portainer"
mkdir -p dist
set -x
cd 'api/cmd/portainer'
mkdir -p dist
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"
# the build takes 2 seconds
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \
--installsuffix cgo \
--ldflags '-s' \
-o "../dist/portainer" \
./cmd/portainer/

@ -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",

Loading…
Cancel
Save