-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (42 loc) · 1.28 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
setup:
# install brew if not installed
ifeq (, $(shell which brew))
$(info "brew not found, install...")
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
endif
# install docker if not installed
ifeq (, $(shell which docker))
$(info "docker not found, install...")
brew install --cask docker
endif
# install helm if not installed
ifeq (, $(shell which helm))
$(info "helm not found, install...")
brew install helm
endif
# install rust if not installed
ifeq (, $(shell which rustc))
$(info "rust not found, install...")
curl https://sh.rustup.rs -sSf | sh
endif
# update /etc/hosts (required for deploy with helm)
ifeq (, $(shell cat /etc/hosts | grep dev-wep-api.com))
$(info "update /etc/hosts...")
echo "127.0.0.1 dev-wep-api.com" | sudo tee -a /etc/hosts
endif
rustup component add rustfmt
rustup component add clippy
rustup component add llvm-tools-preview
cargo install grcov
deploy:
openssl req \
-x509 -newkey rsa:4096 -sha256 -nodes \
-keyout tls.key -out tls.crt \
-subj "/CN=ingress.local" -days 365
kubectl create secret tls api-secret \
--cert=tls.crt \
--key=tls.key
helm upgrade --install --atomic --timeout 300s --wait web-api-dev helm
delete:
helm delete web-api-dev
kubectl delete secret api-secret --ignore-not-found