goshort/Makefile

41 lines
759 B
Makefile
Raw Permalink Normal View History

2023-08-19 02:03:42 -03:00
.PHONY: install frontend backend all dev
2023-08-30 23:17:05 -03:00
install-frontend:
2023-08-19 02:03:42 -03:00
npm ci --prefix frontend
2023-08-30 23:17:05 -03:00
install-backend:
go mod download
install: install-frontend install-backend
2023-08-19 02:03:42 -03:00
frontend:
2024-03-23 15:56:02 -03:00
VITE_API_URL=/api VITE_OIDC_URL=/odc npm run --prefix frontend build
2023-08-19 02:03:42 -03:00
2023-09-06 13:00:56 -03:00
VERSION=$(shell git describe --tags --abbrev=0)
2023-08-19 02:03:42 -03:00
backend:
2023-09-06 13:00:56 -03:00
CGO_ENABLED=0 go build -v -ldflags="-X 'main.version=${VERSION}'" -o goshort goshort.go
2023-08-19 02:03:42 -03:00
2023-08-30 23:17:05 -03:00
all: frontend backend
2023-08-19 02:03:42 -03:00
serve:
go run goshort.go serve
dev:
go run goshort.go dev
2023-09-21 22:56:01 -03:00
lint-frontend:
2024-03-23 15:56:02 -03:00
VITE_API_URL=/api VITE_OIDC_URL=/odc npm run --prefix frontend lint
2023-09-21 22:56:01 -03:00
lint-frontend-fix:
2024-03-23 15:56:02 -03:00
VITE_API_URL=/api VITE_OIDC_URL=/odc npm run --prefix frontend lint:fix
2023-09-21 22:56:01 -03:00
lint-backend:
2023-08-19 02:03:42 -03:00
golangci-lint run
2023-09-21 22:56:01 -03:00
lint-backend-fix:
2023-08-19 02:03:42 -03:00
golangci-lint run --fix
2023-09-21 22:56:01 -03:00
test:
go test -v ./...