-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
42 lines (34 loc) · 1.26 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
# Define variables
TERRAFORM_DIR=terraform
DOCKER_COMPOSE_FILE=docker-compose.yml
# Default target when `make` is run without arguments
.DEFAULT_GOAL := help
.PHONY: help
help: ## Show this help message
@echo ""
@echo "If running for the first time, run in order 1~5"
@echo "Usage: make [option]"
@echo ""
@echo "Options:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
@echo ""
@echo "Make sure to place your kaggle.json and gcp-creds.json files in $(TERRAFORM_DIR)/keys/ so that Terraform and Mage can access them."
@echo ""
.PHONY: gcp-tf-init
gcp-tf-init: ## 1. Initialize GCP resources
cd $(TERRAFORM_DIR) && terraform init
.PHONY: gcp-tf-plan
gcp-tf-plan: ## 2. See GCP resources to be created
cd $(TERRAFORM_DIR) && terraform plan
.PHONY: gcp-tf-apply
gcp-tf-apply: ## 3. Create GCP resources
cd $(TERRAFORM_DIR) && terraform apply -auto-approve
.PHONY: docker-build
docker-build: ## 4. Build Mage environment
docker-compose -f $(DOCKER_COMPOSE_FILE) build
.PHONY: docker-up
docker-up: ## 5. Start Mage environment
docker-compose -f $(DOCKER_COMPOSE_FILE) up -d
.PHONY: docker-down
docker-down: ## 6. Stop Mage environment
docker-compose -f $(DOCKER_COMPOSE_FILE) down