-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
115 lines (103 loc) · 4.73 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
test-deploy-script:
bash -c "COMMIT_SHA=617db9598c8dd607e43fdd1172b8037c1d86abde SHORT_SHA=617db95 REPO_NAME=lookit-api BRANCH_NAME=master TAG_NAME=latest deploy.sh"
bash -c "COMMIT_SHA=617db9598c8dd607e43fdd1172b8037c1d86abde SHORT_SHA=617db95 REPO_NAME=lookit-api BRANCH_NAME=develop TAG_NAME=latest deploy.sh"
test-cloud-build:
cloud-build-local --dryrun=false --substitutions COMMIT_SHA=d34db33fdabbad00babe,SHORT_SHA=d34dbee,REPO_NAME=lookit-api,BRANCH_NAME=master,TAG_NAME=0.0.1 .
encrypt-prod:
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/production/lookit-secrets.env \
--ciphertext-file=kubernetes/lookit/environments/production/lookit-secrets.env.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/production/googleAppCreds.json \
--ciphertext-file=kubernetes/lookit/environments/production/googleAppCreds.json.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/production/cloudsql-client-creds.json \
--ciphertext-file=kubernetes/lookit/environments/production/cloudsql-client-creds.json.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
encrypt-staging:
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/staging/lookit-secrets.env \
--ciphertext-file=kubernetes/lookit/environments/staging/lookit-secrets.env.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/staging/googleAppCreds.json \
--ciphertext-file=kubernetes/lookit/environments/staging/googleAppCreds.json.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms encrypt \
--plaintext-file=kubernetes/lookit/environments/staging/cloudsql-client-creds.json \
--ciphertext-file=kubernetes/lookit/environments/staging/cloudsql-client-creds.json.enc \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
decrypt-prod:
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/production/lookit-secrets.env.enc \
--plaintext-file=kubernetes/lookit/environments/production/lookit-secrets.env \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/production/googleAppCreds.json.enc \
--plaintext-file=kubernetes/lookit/environments/production/googleAppCreds.json \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/production/cloudsql-client-creds.json.enc \
--plaintext-file=kubernetes/lookit/environments/production/cloudsql-client-creds.json \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
decrypt-staging:
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/staging/lookit-secrets.env.enc \
--plaintext-file=kubernetes/lookit/environments/staging/lookit-secrets.env \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/staging/googleAppCreds.json.enc \
--plaintext-file=kubernetes/lookit/environments/staging/googleAppCreds.json \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
gcloud kms decrypt \
--ciphertext-file=kubernetes/lookit/environments/staging/cloudsql-client-creds.json.enc \
--plaintext-file=kubernetes/lookit/environments/staging/cloudsql-client-creds.json \
--location=us-east1 \
--keyring=lookit-keyring \
--key=kubernetes-secrets \
--project=mit-lookit-keys
encrypt: encrypt-prod encrypt-staging
ingress:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/mandatory.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.30.0/deploy/static/provider/cloud-generic.yaml
cert-manager:
kubectl create namespace cert-manager
kubectl apply --validate=false -f https://github.com/jetstack/cert-manager/releases/download/v0.14.0/cert-manager.yaml
clean:
rm kubernetes/manifests/*/*.yaml
.PHONY: test-deploy-script test-cloud-build encrypt-staging encrypt-prod decrypt-prod decrypt-staging ingress clean