-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathGNUmakefile
67 lines (48 loc) · 1.81 KB
/
GNUmakefile
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
default: build
ARGOCD_INSECURE?=true
ARGOCD_SERVER?=127.0.0.1:8080
ARGOCD_AUTH_USERNAME?=admin
ARGOCD_AUTH_PASSWORD?=acceptancetesting
ARGOCD_VERSION?=v2.12.8
export
build:
go build -v ./...
install: build
go install -v ./...
# See https://golangci-lint.run/
lint:
golangci-lint run
generate:
cd tools; go generate ./...
fmt:
gofmt -s -w -e .
test:
go test -v -cover -timeout=120s -parallel=4 ./...
testacc:
TF_ACC=1 go test -v -cover -timeout 20m ./...
testacc_clean_env:
kind delete cluster --name argocd
testacc_prepare_env:
echo "\n--- Clearing current kube context\n"
kubectl config unset current-context
echo "\n--- Kustomize sanity checks\n"
kustomize version || exit 1
echo "\n--- Create Kind cluster\n"
kind create cluster --config kind-config.yml
echo "\n--- Kind sanity checks\n"
kubectl get nodes -o wide
kubectl get pods --all-namespaces -o wide
kubectl get services --all-namespaces -o wide
echo "\n--- Fetch ArgoCD installation manifests\n"
curl https://raw.githubusercontent.com/argoproj/argo-cd/${ARGOCD_VERSION}/manifests/install.yaml > manifests/install/argocd.yml
echo "\n--- Install ArgoCD ${ARGOCD_VERSION}\n"
kustomize build manifests/install | kubectl apply -f - && \
kubectl apply -f manifests/testdata/
echo "\n--- Wait for ArgoCD components to be ready...\n"
kubectl wait --for=condition=available --timeout=600s deployment/argocd-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-repo-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-dex-server -n argocd
kubectl wait --for=condition=available --timeout=30s deployment/argocd-redis -n argocd
clean:
git clean -fXd -e \!vendor -e \!vendor/**/* -e \!.vscode
.PHONY: build install lint generate fmt test testacc testacc_clean_env testacc_prepare_env clean