Remove -mod=vendor and mount pkg/mod instead
See gotify/plugin-template#4 tl;dr: Using vendor makes plugins incompatible.
This commit is contained in:
parent
5a594261ca
commit
4814fe8d43
29
Makefile
29
Makefile
|
|
@ -1,8 +1,12 @@
|
||||||
LICENSE_DIR=./licenses/
|
LICENSE_DIR=./licenses/
|
||||||
BUILD_DIR=./build/
|
BUILD_DIR=./build
|
||||||
DOCKER_DIR=./docker/
|
DOCKER_DIR=./docker/
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
GO_VERSION=`cat GO_VERSION`
|
GO_VERSION=`cat GO_VERSION`
|
||||||
|
DOCKER_BUILD_IMAGE=gotify/build
|
||||||
|
DOCKER_WORKDIR=/proj
|
||||||
|
DOCKER_RUN=docker run --rm -v "$$PWD/.:${DOCKER_WORKDIR}" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w ${DOCKER_WORKDIR}
|
||||||
|
DOCKER_GO_BUILD=go build -mod=readonly -a -installsuffix cgo -ldflags "$$LD_FLAGS"
|
||||||
|
|
||||||
test: test-coverage test-race test-js
|
test: test-coverage test-race test-js
|
||||||
check: check-go check-swagger check-js
|
check: check-go check-swagger check-js
|
||||||
|
|
@ -62,33 +66,30 @@ extract-licenses:
|
||||||
done
|
done
|
||||||
|
|
||||||
package-zip: extract-licenses
|
package-zip: extract-licenses
|
||||||
for BUILD in $(shell find ${BUILD_DIR}*); do \
|
for BUILD in $(shell find ${BUILD_DIR}/*); do \
|
||||||
zip -j $$BUILD.zip $$BUILD ./LICENSE; \
|
zip -j $$BUILD.zip $$BUILD ./LICENSE; \
|
||||||
zip -ur $$BUILD.zip ${LICENSE_DIR}; \
|
zip -ur $$BUILD.zip ${LICENSE_DIR}; \
|
||||||
done
|
done
|
||||||
|
|
||||||
build-docker: require-version
|
build-docker: require-version
|
||||||
cp ${BUILD_DIR}gotify-linux-amd64 ./docker/gotify-app
|
cp ${BUILD_DIR}/gotify-linux-amd64 ./docker/gotify-app
|
||||||
(cd ${DOCKER_DIR} && docker build -t gotify/server:latest -t gotify/server:${VERSION} .)
|
(cd ${DOCKER_DIR} && docker build -t gotify/server:latest -t gotify/server:${VERSION} .)
|
||||||
rm ${DOCKER_DIR}gotify-app
|
rm ${DOCKER_DIR}gotify-app
|
||||||
|
|
||||||
build-js:
|
build-js:
|
||||||
(cd ui && npm run build)
|
(cd ui && npm run build)
|
||||||
|
|
||||||
vendor:
|
build-linux-amd64:
|
||||||
go mod vendor
|
${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-linux-amd64 ${DOCKER_GO_BUILD} -o ${BUILD_DIR}/gotify-linux-amd64 ${DOCKER_WORKDIR}
|
||||||
|
|
||||||
build-linux-amd64: vendor
|
build-linux-arm-7:
|
||||||
docker run --rm -v "$$PWD/.:/proj" -w /proj gotify/build:$(GO_VERSION)-linux-amd64 go build -mod=vendor -a -installsuffix cgo -ldflags "$$LD_FLAGS" -o build/gotify-linux-amd64 /proj
|
${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-linux-arm-7 ${DOCKER_GO_BUILD} -o ${BUILD_DIR}/gotify-linux-arm-7 ${DOCKER_WORKDIR}
|
||||||
|
|
||||||
build-linux-arm-7: vendor
|
build-linux-arm64:
|
||||||
docker run --rm -v "$$PWD/.:/proj" -w /proj gotify/build:$(GO_VERSION)-linux-arm-7 go build -mod=vendor -a -installsuffix cgo -ldflags "$$LD_FLAGS" -o build/gotify-linux-arm-7 /proj
|
${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-linux-arm64 ${DOCKER_GO_BUILD} -o ${BUILD_DIR}/gotify-linux-arm64 ${DOCKER_WORKDIR}
|
||||||
|
|
||||||
build-linux-arm64: vendor
|
build-windows-amd64:
|
||||||
docker run --rm -v "$$PWD/.:/proj" -w /proj gotify/build:$(GO_VERSION)-linux-arm64 go build -mod=vendor -a -installsuffix cgo -ldflags "$$LD_FLAGS" -o build/gotify-linux-arm64 /proj
|
${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-windows-amd64 ${DOCKER_GO_BUILD} -o ${BUILD_DIR}/gotify-windows-amd64.exe ${DOCKER_WORKDIR}
|
||||||
|
|
||||||
build-windows-amd64: vendor
|
|
||||||
docker run --rm -v "$$PWD/.:/proj" -w /proj gotify/build:$(GO_VERSION)-windows-amd64 go build -mod=vendor -a -installsuffix cgo -ldflags "$$LD_FLAGS" -o build/gotify-windows-amd64.exe /proj
|
|
||||||
|
|
||||||
build: build-linux-arm-7 build-linux-amd64 build-linux-arm64 build-windows-amd64
|
build: build-linux-arm-7 build-linux-amd64 build-linux-arm64 build-windows-amd64
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue