-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile
40 lines (32 loc) · 1.03 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
NAME:=kubesec-webhook
DOCKER_REPOSITORY:=controlplaneio
DOCKER_IMAGE_NAME:=$(DOCKER_REPOSITORY)/$(NAME)
GITREPO:=github.com/controlplaneio/kubesec-webhook
GITCOMMIT:=$(shell git describe --dirty --always)
VERSION:=0.1-dev
.PHONY: build
build:
docker build -t $(DOCKER_IMAGE_NAME):$(VERSION) -f Dockerfile .
.PHONY: push
push:
docker push $(DOCKER_IMAGE_NAME):$(VERSION)
.PHONY: test
test:
cd pkg/webhook ; go test -v -race ./...
.PHONY: certs
certs:
cd deploy && ./gen-certs.sh
.PHONY: deploy
deploy:
kubectl create namespace kubesec --dry-run=client -oyaml | kubectl apply -f -
kubectl apply -f ./deploy/
.PHONY: delete
delete:
kubectl delete namespace kubesec
kubectl delete -f ./deploy/webhook-registration.yaml
travis_push:
@docker tag $(DOCKER_IMAGE_NAME):$(VERSION) $(DOCKER_IMAGE_NAME):$(TRAVIS_BRANCH)-$(GITCOMMIT)
@docker push $(DOCKER_IMAGE_NAME):$(TRAVIS_BRANCH)-$(GITCOMMIT)
travis_release:
@docker tag $(DOCKER_IMAGE_NAME):$(VERSION) $(DOCKER_IMAGE_NAME):$(TRAVIS_TAG)
@docker push $(DOCKER_IMAGE_NAME):$(TRAVIS_TAG)