-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (46 loc) · 1.58 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
.PHONY: install-requirements
install-requirements:
brew install minikube && \
brew install kubectl && \
brew install jq && \
brew install yq
.PHONY: start-minikube
start-minikube:
minikube start
.PHONY: build-minikube-airflow-image
build-minikube-airflow-image: start-minikube
minikube image build \
-t local-airflow-image \
--build-env POD_TEMPLATE_FILE=/opt/airflow/pod-template-local.yaml \
-f ./images/airflow.Dockerfile .
.PHONY: apply-kube-manifests-%
apply-kube-manifests-%:
./scripts/apply-kube-manifests.sh $*
.PHONY: login-docker
login-docker:
aws ecr get-login-password --region ${REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com
.PHONY: build-ecr-airflow-image
build-ecr-airflow-image: login-docker
yq -i '.spec.containers[].image = strenv(DOCKER_IMAGE)' ./images/pod-template-prod.yaml
docker build \
--platform linux/amd64 \
-t ${AWS_ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/airflow:prod \
-f ./images/airflow.Dockerfile .
.PHONY: push-ecr-airflow-image
push-ecr-airflow-image: build-ecr-airflow-image
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${REGION}.amazonaws.com/airflow:prod
.PHONY: lint-yaml
lint-yaml:
yamllint -c manifests/.yamllint manifests
.PHONY: terraform-apply
terraform-apply:
cd terraform/${REGION} && terraform apply
.PHONY: terraform-destroy
terraform-destroy:
cd terraform/${REGION} && terraform destroy
.PHONY: update-kubeconfig
update-kubeconfig:
aws eks --region ${REGION} update-kubeconfig --name airflow
.PHONY: set-kube-secrets-%
set-kube-secrets-%:
./scripts/set-kube-secrets.sh $*