forked from gardener/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (24 loc) · 833 Bytes
/
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
ORGANIZATION := gardener
PROJECT := dashboard
VERSION ?= $(shell ./scripts/git-version)
REGISTRY := eu.gcr.io/gardener-project
IMAGE := $(REGISTRY)/$(ORGANIZATION)/$(PROJECT)
TAG := $(VERSION)
.PHONY: build
build: clean
@npm run --prefix frontend -s build
.PHONY: docker-image
docker-image: build
docker build -t $(IMAGE):$(TAG) --rm .
.PHONY: docker-login
docker-login:
@gcloud auth activate-service-account --key-file ~/.config/gcloud/gcr-readwrite.json
.PHONY: docker-push
docker-push:
@if ! docker images $(IMAGE) | awk '{ print $$2 }' | grep -q -F $(TAG); then echo "$(IMAGE) version $(TAG) is not yet built. Please run 'make docker-image'"; false; fi
@gcloud docker -- push $(IMAGE):$(TAG)
.PHONY: release
release: docker-image docker-login docker-push
.PHONY: clean
clean:
@rm -rf frontend/dist