forked from maksim-paskal/hcloud-k8s-ctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (66 loc) · 2.36 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
KUBECONFIG=$(HOME)/.kube/hcloud
action=list-configurations
config=config.yaml
fullConfig=./e2e/configs/full.yaml
args=""
branch=`git rev-parse --abbrev-ref HEAD`
test:
./scripts/validate-license.sh
go fmt ./cmd/... ./pkg/...
go mod tidy
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run -v
CONFIG=config_test.yaml go test -race -coverprofile coverage.out ./cmd/... ./pkg/...
.PHONY: e2e
e2e:
GIT_BRANCH=$(branch) go test -v -count=1 -timeout=4h ./e2e/e2e_test.go
update-readme:
go run ./utils/main.go
coverage:
go tool cover -html=coverage.out
create-cluster:
make test
make delete-cluster
go run -race ./cmd -config=$(config) -action=create -log.level=DEBUG
delete-cluster:
go run -race ./cmd -config=$(config) -action=delete -log.level=DEBUG
patch-cluster:
make run action=patch-cluster
list-configurations:
make run action=list-configurations
upgrade-controlplane:
make run action=upgrade-controlplane
create-firewall:
make run action=create-firewall
save-full-config:
make run action=save-full-config args=-save-config-path=$(fullConfig)
upgrade-workers: # restart all pods on worker node
make run action=adhoc args="-adhoc.copynewfile -adhoc.command=/root/scripts/upgrade-worker.sh"
upgrade-workers-kernel: # upgrade kernel and restart worker node
make run action=adhoc args="-adhoc.copynewfile -adhoc.command=/root/scripts/upgrade-kernel.sh"
run:
go run -race ./cmd -config=$(config) -action=$(action) -log.level=DEBUG $(args)
build:
go run github.com/goreleaser/goreleaser@latest build --clean --skip=validate
apply-yaml:
kubectl apply -f ./scripts
apply-test:
helm upgrade --install test ./examples/charts/test
delete-tests:
helm delete test || true
test-kubernetes-yaml:
make save-full-config
helm dep up ./scripts/chart
helm lint ./scripts/chart --values=$(fullConfig)
helm lint ./examples/charts/test --values=$(fullConfig)
helm template ./scripts/chart --values=$(fullConfig) | kubectl apply --dry-run=client --validate=true -f -
helm template ./examples/charts/test --values=$(fullConfig) | kubectl apply --dry-run=client --validate=true -f -
install:
go run github.com/goreleaser/goreleaser@latest build \
--single-target \
--clean \
--snapshot \
--skip=validate \
--output /tmp/hcloud-k8s-ctl
sudo mv /tmp/hcloud-k8s-ctl /usr/local/bin/hcloud-k8s-ctl
ubuntu-versions:
docker run -v `pwd`:/app -it ubuntu:20.04 /app/scripts/ubuntu-versions.sh