forked from eksctl-io/eksctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (69 loc) · 2.62 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
built_at := $(shell date +%s)
git_commit := $(shell git describe --dirty --always)
EKSCTL_BUILD_IMAGE ?= weaveworks/eksctl:build
EKSCTL_IMAGE ?= weaveworks/eksctl:latest
.PHONY: build
build:
@go build -ldflags "-X main.gitCommit=$(git_commit) -X main.builtAt=$(built_at)" ./cmd/eksctl
.PHONY: install-build-deps
install-build-deps:
@cd build && dep ensure && ./install.sh
.PHONY: test
test: generate
@git diff --exit-code pkg/nodebootstrap/assets.go > /dev/null || (git diff; exit 1)
@git diff --exit-code ./pkg/eks/mocks > /dev/null || (git diff; exit 1)
@go test -v -covermode=count -coverprofile=coverage.out ./pkg/... ./cmd/...
@test -z $(COVERALLS_TOKEN) || goveralls -coverprofile=coverage.out -service=circle-ci
.PHONY: integration-test-dev
integration-test-dev: build
@go test -tags integration -v -timeout 21m ./tests/integration/... \
-args \
-eksctl.cluster=integration-test-dev \
-eksctl.create=false \
-eksctl.delete=false \
-eksctl.kubeconfig=$(HOME)/.kube/eksctl/clusters/integration-test-dev
create-integration-test-dev-cluster: build
@./eksctl create cluster --name=integration-test-dev --auto-kubeconfig
delete-integration-test-dev-cluster: build
@./eksctl delete cluster --name=integration-test-dev --auto-kubeconfig
.PHONY: integration-test
integration-test: build
@go test -tags integration -v -timeout 21m ./tests/integration/...
.PHONY: generate
generate:
@chmod g-w ./pkg/nodebootstrap/assets/*
@go generate ./pkg/nodebootstrap ./pkg/eks/mocks
.PHONY: eksctl-build-image
eksctl-build-image:
@-docker pull $(EKSCTL_BUILD_IMAGE)
@docker build --tag=$(EKSCTL_BUILD_IMAGE) --cache-from=$(EKSCTL_BUILD_IMAGE) ./build
EKSCTL_IMAGE_BUILD_ARGS := --build-arg=EKSCTL_BUILD_IMAGE=$(EKSCTL_BUILD_IMAGE)
ifneq ($(COVERALLS_TOKEN),)
EKSCTL_IMAGE_BUILD_ARGS += --build-arg=COVERALLS_TOKEN=$(COVERALLS_TOKEN)
endif
.PHONY: eksctl-image
eksctl-image: eksctl-build-image
@docker build --tag=$(EKSCTL_IMAGE) $(EKSCTL_IMAGE_BUILD_ARGS) ./
.PHONY: release
release: eksctl-build-image
@docker run \
--env=GITHUB_TOKEN \
--env=CIRCLE_TAG \
--env=CIRCLE_PROJECT_USERNAME \
--volume=$(CURDIR):/go/src/github.com/weaveworks/eksctl \
--workdir=/go/src/github.com/weaveworks/eksctl \
$(EKSCTL_BUILD_IMAGE) \
./do-release.sh
JEKYLL := docker run --tty --rm \
--name=eksctl-jekyll \
--volume="$(CURDIR)":/usr/src/app \
--publish="4000:4000" \
starefossen/github-pages
.PHONY: server-pages
serve-pages:
@-docker rm -f eksctl-jekyll
@$(JEKYLL) jekyll serve -d /_site --watch --force_polling -H 0.0.0.0 -P 4000
.PHONY: build-page
build-pages:
@-docker rm -f eksctl-jekyll
@$(JEKYLL) jekyll build --verbose