-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1.22 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
VERSION ?= $(shell git describe --always --tags)
DOCKER_TAG ?= latest
export DOCKER_BUILDKIT=1
.DEFAULT_GOAL := help
.PHONY: install
install: ## Install npm dependencies
npm install
.PHONY: build
build: install ## Build npm project
npm run build
.PHONY: build_docker
build_docker: ## Build docker image
docker build --tag=camptocamp/geoshop-front:$(VERSION) \
--build-arg=VERSION=$(VERSION) .
docker tag camptocamp/geoshop-front:$(VERSION) camptocamp/geoshop-front:$(DOCKER_TAG)
.PHONY: build_ghcr
build_ghcr: ## Build docker image tagged for GHCR
docker build --tag=ghcr.io/camptocamp/geoshop-front:$(VERSION) \
--build-arg=VERSION=$(VERSION) .
docker tag ghcr.io/camptocamp/geoshop-front:$(VERSION) ghcr.io/camptocamp/geoshop-front:$(DOCKER_TAG)
.PHONY: push_ghcr
push_ghcr: ## Push docker image to GHCR
docker push ghcr.io/camptocamp/geoshop-front:$(VERSION)
docker push ghcr.io/camptocamp/geoshop-front:$(DOCKER_TAG)
.PHONY: test
test: install ## Run tests
npm test
.PHONY: help
help: ## Display this help
@echo "Usage: make <target>"
@echo
@echo "Available targets:"
@grep --extended-regexp --no-filename '^[a-zA-Z_-]+:.*## ' $(MAKEFILE_LIST) | sort | \
awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s%s\n", $$1, $$2}'