Add static build target #83
This commit is contained in:
parent
6576f4e2af
commit
1b0b41b824
2 changed files with 10 additions and 2 deletions
3
Makefile
3
Makefile
|
@ -48,6 +48,9 @@ build-js:
|
|||
build-go:
|
||||
rm -f $(BINARY_NAME)
|
||||
scripts/build.sh debug $(BINARY_NAME)
|
||||
build-static:
|
||||
rm -f $(BINARY_NAME)
|
||||
scripts/build.sh static $(BINARY_NAME)
|
||||
watch-js:
|
||||
(cd frontend && env NODE_ENV=development npm run watch)
|
||||
test-js:
|
||||
|
|
|
@ -30,9 +30,14 @@ if [[ $1 == "debug" ]]; then
|
|||
go build -ldflags "-X main.version=${PHOTOPRISM_DATE}-${PHOTOPRISM_VERSION}-${PHOTOPRISM_OS}-${PHOTOPRISM_ARCH}-DEBUG" -o $2 cmd/photoprism/photoprism.go
|
||||
du -h $2
|
||||
echo "Done."
|
||||
elif [[ $1 == "static" ]]; then
|
||||
echo "Building static production binary..."
|
||||
go build -a -v -ldflags "-linkmode external -extldflags \"-static -L /usr/local/lib\" -s -w -X main.version=${PHOTOPRISM_DATE}-${PHOTOPRISM_VERSION}-${PHOTOPRISM_OS}-${PHOTOPRISM_ARCH}" -o $2 cmd/photoprism/photoprism.go
|
||||
du -h $2
|
||||
echo "Done."
|
||||
else
|
||||
echo "Building production binary..."
|
||||
echo "Building production binary..."
|
||||
go build -ldflags "-s -w -X main.version=${PHOTOPRISM_DATE}-${PHOTOPRISM_VERSION}-${PHOTOPRISM_OS}-${PHOTOPRISM_ARCH}" -o $2 cmd/photoprism/photoprism.go
|
||||
du -h $2
|
||||
echo "Done."
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue