build: add a simple build as default target, trying to make LGTM work
This commit is contained in:
@@ -3,28 +3,32 @@ NODE_VERSION=$(shell cat .nvmrc)
|
|||||||
|
|
||||||
GIT_SHA=$(shell git rev-parse --short HEAD)
|
GIT_SHA=$(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
.PHONY: dev
|
## Default target just build the Go project.
|
||||||
|
default:
|
||||||
|
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master"
|
||||||
|
.PHONY: default
|
||||||
|
|
||||||
dev: check_env
|
dev: check_env
|
||||||
@goreman -f Procfile.dev -b 4533 start
|
@goreman -f Procfile.dev -b 4533 start
|
||||||
|
.PHONY: dev
|
||||||
|
|
||||||
.PHONY: server
|
|
||||||
server: check_go_env
|
server: check_go_env
|
||||||
@reflex -d none -c reflex.conf
|
@reflex -d none -c reflex.conf
|
||||||
|
.PHONY: server
|
||||||
|
|
||||||
.PHONY: watch
|
|
||||||
watch: check_go_env
|
watch: check_go_env
|
||||||
ginkgo watch -notify ./...
|
ginkgo watch -notify ./...
|
||||||
|
.PHONY: watch
|
||||||
|
|
||||||
.PHONY: test
|
|
||||||
test: check_go_env
|
test: check_go_env
|
||||||
go test ./... -v
|
go test ./... -v
|
||||||
# @(cd ./ui && npm test -- --watchAll=false)
|
# @(cd ./ui && npm test -- --watchAll=false)
|
||||||
|
.PHONY: test
|
||||||
|
|
||||||
.PHONY: testall
|
|
||||||
testall: check_go_env test
|
testall: check_go_env test
|
||||||
@(cd ./ui && npm test -- --watchAll=false)
|
@(cd ./ui && npm test -- --watchAll=false)
|
||||||
|
.PHONY: testall
|
||||||
|
|
||||||
.PHONY: setup
|
|
||||||
setup: Jamstash-master
|
setup: Jamstash-master
|
||||||
@which goconvey || (echo "Installing GoConvey" && GO111MODULE=off go get -u github.com/smartystreets/goconvey)
|
@which goconvey || (echo "Installing GoConvey" && GO111MODULE=off go get -u github.com/smartystreets/goconvey)
|
||||||
@which wire || (echo "Installing Wire" && GO111MODULE=off go get -u github.com/google/wire/cmd/wire)
|
@which wire || (echo "Installing Wire" && GO111MODULE=off go get -u github.com/google/wire/cmd/wire)
|
||||||
@@ -35,40 +39,40 @@ setup: Jamstash-master
|
|||||||
@which goose || (echo "Installing Goose" && GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose)
|
@which goose || (echo "Installing Goose" && GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose)
|
||||||
go mod download
|
go mod download
|
||||||
@(cd ./ui && npm ci)
|
@(cd ./ui && npm ci)
|
||||||
|
.PHONY: setup
|
||||||
|
|
||||||
.PHONY: static
|
|
||||||
static:
|
static:
|
||||||
cd static && go-bindata -fs -prefix "static" -nocompress -ignore="\\\*.go" -pkg static .
|
cd static && go-bindata -fs -prefix "static" -nocompress -ignore="\\\*.go" -pkg static .
|
||||||
|
.PHONY: static
|
||||||
|
|
||||||
Jamstash-master:
|
Jamstash-master:
|
||||||
wget -N https://github.com/tsquillario/Jamstash/archive/master.zip
|
wget -N https://github.com/tsquillario/Jamstash/archive/master.zip
|
||||||
unzip -o master.zip
|
unzip -o master.zip
|
||||||
rm master.zip
|
rm master.zip
|
||||||
|
|
||||||
.PHONE: check_env
|
|
||||||
check_env: check_go_env check_node_env
|
check_env: check_go_env check_node_env
|
||||||
|
.PHONE: check_env
|
||||||
|
|
||||||
.PHONY: check_go_env
|
|
||||||
check_go_env:
|
check_go_env:
|
||||||
@(hash go) || (echo "\nERROR: GO environment not setup properly!\n"; exit 1)
|
@(hash go) || (echo "\nERROR: GO environment not setup properly!\n"; exit 1)
|
||||||
@go version | grep -q $(GO_VERSION) || (echo "\nERROR: Please upgrade your GO version\nThis project requires version $(GO_VERSION)"; exit 1)
|
@go version | grep -q $(GO_VERSION) || (echo "\nERROR: Please upgrade your GO version\nThis project requires version $(GO_VERSION)"; exit 1)
|
||||||
|
.PHONY: check_go_env
|
||||||
|
|
||||||
.PHONY: check_node_env
|
|
||||||
check_node_env:
|
check_node_env:
|
||||||
@(hash node) || (echo "\nERROR: Node environment not setup properly!\n"; exit 1)
|
@(hash node) || (echo "\nERROR: Node environment not setup properly!\n"; exit 1)
|
||||||
@node --version | grep -q $(NODE_VERSION) || (echo "\nERROR: Please check your Node version. Should be $(NODE_VERSION)\n"; exit 1)
|
@node --version | grep -q $(NODE_VERSION) || (echo "\nERROR: Please check your Node version. Should be $(NODE_VERSION)\n"; exit 1)
|
||||||
|
.PHONY: check_node_env
|
||||||
|
|
||||||
.PHONY: build
|
|
||||||
build: check_go_env
|
build: check_go_env
|
||||||
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master"
|
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master"
|
||||||
|
.PHONY: build
|
||||||
|
|
||||||
.PHONY: buildall
|
|
||||||
buildall: check_env
|
buildall: check_env
|
||||||
@(cd ./ui && npm run build)
|
@(cd ./ui && npm run build)
|
||||||
go-bindata -fs -prefix "ui/build" -tags embed -nocompress -pkg assets -o assets/embedded_gen.go ui/build/...
|
go-bindata -fs -prefix "ui/build" -tags embed -nocompress -pkg assets -o assets/embedded_gen.go ui/build/...
|
||||||
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master" -tags=embed
|
go build -ldflags="-X github.com/deluan/navidrome/consts.gitSha=$(GIT_SHA) -X github.com/deluan/navidrome/consts.gitTag=master" -tags=embed
|
||||||
|
.PHONY: buildall
|
||||||
|
|
||||||
.PHONY: release
|
|
||||||
release:
|
release:
|
||||||
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
|
@if [[ ! "${V}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$$ ]]; then echo "Usage: make release V=X.X.X"; exit 1; fi
|
||||||
go mod tidy
|
go mod tidy
|
||||||
@@ -76,7 +80,8 @@ release:
|
|||||||
make test
|
make test
|
||||||
git tag v${V}
|
git tag v${V}
|
||||||
git push origin v${V}
|
git push origin v${V}
|
||||||
|
.PHONY: release
|
||||||
|
|
||||||
.PHONY: dist
|
|
||||||
dist:
|
dist:
|
||||||
docker run -it -v $(PWD):/github/workspace -w /github/workspace bepsays/ci-goreleaser:1.14-1 goreleaser release --rm-dist --skip-publish --snapshot
|
docker run -it -v $(PWD):/github/workspace -w /github/workspace bepsays/ci-goreleaser:1.14-1 goreleaser release --rm-dist --skip-publish --snapshot
|
||||||
|
.PHONY: dist
|
||||||
|
|||||||
Reference in New Issue
Block a user