chore: use .env file in make tasks

This commit is contained in:
wpetit 2022-05-10 22:38:05 +02:00
parent b449e46f41
commit 9281685f09
2 changed files with 7 additions and 6 deletions

View File

@ -0,0 +1 @@
GITHUB_TOKEN=

View File

@ -6,15 +6,16 @@ TAILWINDCSS_ARGS ?=
GORELEASER_VERSION ?= v1.8.3 GORELEASER_VERSION ?= v1.8.3
GORELEASER_ARGS ?= --auto-snapshot --rm-dist GORELEASER_ARGS ?= --auto-snapshot --rm-dist
GITCHLOG_ARGS ?= GITCHLOG_ARGS ?=
SHELL := /bin/bash
.PHONY: help .PHONY: help
help: ## Display this help help: ## Display this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
watch: ## Watching updated files - live reload watch: deps ## Watching updated files - live reload
go run -mod=readonly github.com/cortesi/modd/cmd/modd@latest ( set -o allexport && source .env && set +o allexport && go run -mod=readonly github.com/cortesi/modd/cmd/modd@latest )
test: .env ## Executing tests test: deps ## Executing tests
( set -o allexport && source .env && set +o allexport && go test -v -race -count=1 $(GOTEST_ARGS) ./... ) ( set -o allexport && source .env && set +o allexport && go test -v -race -count=1 $(GOTEST_ARGS) ./... )
lint: ## Lint sources code lint: ## Lint sources code
@ -35,19 +36,18 @@ internal/server/assets/dist/main.css: tailwind
cp .env.dist .env cp .env.dist .env
.PHONY: deps .PHONY: deps
deps: node_modules deps: .env node_modules
node_modules: node_modules:
npm ci npm ci
.PHONY: release .PHONY: release
release: deps release: deps
VERSION=$(GORELEASER_VERSION) curl -sfL https://goreleaser.com/static/run | bash /dev/stdin $(GORELEASER_ARGS) ( set -o allexport && source .env && set +o allexport && VERSION=$(GORELEASER_VERSION) curl -sfL https://goreleaser.com/static/run | bash /dev/stdin $(GORELEASER_ARGS) )
.PHONY: changelog .PHONY: changelog
changelog: changelog:
go run -mod=readonly github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.1 $(GITCHLOG_ARGS) go run -mod=readonly github.com/git-chglog/git-chglog/cmd/git-chglog@v0.15.1 $(GITCHLOG_ARGS)
install-git-hooks: install-git-hooks:
git config core.hooksPath .githooks git config core.hooksPath .githooks