1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 05:19:39 +02:00

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>
This commit is contained in:
Sven Dowideit 2021-10-28 21:18:13 +10:00 committed by GitHub
parent 33001a8654
commit 76ced401f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 6 deletions

View file

@ -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"
# the build takes 2 seconds
GOOS=$1 GOARCH=$2 CGO_ENABLED=0 go build \
--installsuffix cgo \
--ldflags '-s' \
-o "../dist/portainer" \
./cmd/portainer/