-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (31 loc) · 1.38 KB
/
Makefile
File metadata and controls
43 lines (31 loc) · 1.38 KB
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
VERSION := $(shell cat VERSION)
DOCKER_REPO := "gzur/keightool"
# k8s stuff - this is here to make it easier to override the image
IMAGE ?= $(DOCKER_REPO)
docker.build:
docker build -t $(DOCKER_REPO):$(VERSION) .
docker.push:
@echo "## Pushing $(DOCKER_REPO):$(VERSION)"
@docker push $(DOCKER_REPO):$(VERSION)
@echo "## Pushing $(DOCKER_REPO):latest"
@docker tag "$(DOCKER_REPO):$(VERSION)" "$(DOCKER_REPO):latest"
@docker push "$(DOCKER_REPO):latest"
docker.shell:
docker run -it $(DOCKER_REPO):$(VERSION) fish
k8s.up:
$(eval CURRENT_NAMESPACE := $(shell kubectl config view --minify -o jsonpath='{..namespace}'))
@echo "## Installing keightool into the \"$(CURRENT_NAMESPACE)\" namespace."
@echo "## keightool is running the $(IMAGE) image. Overide by supplying `IMAGE=your-image` to the make command"
cat yaml/* | sed 's~gzur/keightool~$(IMAGE)~g' | kubectl apply -n $(CURRENT_NAMESPACE) -f -
k8s.down:
$(eval CURRENT_NAMESPACE := $(shell kubectl config view --minify -o jsonpath='{..namespace}'))
@echo "## Removing keightool from the \"$(CURRENT_NAMESPACE)\" namespace."
@kubectl delete -f yaml/
k8s.shell:
kubectl exec -it $(shell kubectl get pods -l app=keightool -o jsonpath='{@.items[0].metadata.name}') -- bash
# release stuff for CI
release: docker.build docker.push
ship: tag ## Docker build / push is handled by Github Actions
git push --tags
tag:
git tag "v$(VERSION)"