-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (46 loc) · 2.11 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
##################
### USED BY CI ###
##################
install-k3s: ## Install K3s with default options
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${K3S_VERSION} sh -s - --write-kubeconfig-mode 644
## Wait for K3s to start
timeout 2m bash -c "until ! kubectl get pod -A 2>/dev/null | grep -Eq 'ContainerCreating|CrashLoopBackOff'; do sleep 1; done"
install-helm: ## Install Helm
curl --silent --location https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar xz -C .
sudo mv linux-amd64/helm /usr/local/bin
sudo chown root:root /usr/local/bin/helm
sudo rm -rf linux-amd64/ helm-*.tar.gz
install-cert-manager:
kubectl create namespace cert-manager
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager --namespace cert-manager jetstack/cert-manager \
--set installCRDs=true \
--set extraArgs[0]=--enable-certificate-owner-ref=true
kubectl rollout status deployment cert-manager -n cert-manager --timeout=120s
install-rancher: ## Install Rancher via Helm
helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
helm repo update
helm upgrade --install rancher rancher-latest/rancher --version ${RANCHER_VERSION} \
--namespace cattle-system \
--create-namespace \
--set global.cattle.psp.enabled=false \
--set hostname=${MY_HOSTNAME} \
--set bootstrapPassword=rancherpassword \
--set replicas=1 \
--set rancherImageTag=v${RANCHER_VERSION} \
--wait
kubectl rollout status deployment rancher -n cattle-system --timeout=300s
prepare-e2e-ci-rancher: install-k3s install-helm install-cert-manager install-rancher ## Tests
clean-k3s:
/usr/local/bin/k3s-uninstall.sh
clean-all: clean-k3s
/usr/local/bin/helm repo remove rancher-latest jetstack
########################
### LOCAL DEPLOYMENT ###
########################
cypress-gui: ## Start Cypress in GUI mode, need graphical environment
npm install
./node_modules/cypress/bin/cypress open -C cypress.config.ts
help: ## Show this Makefile's help
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'