-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
61 lines (48 loc) · 2.15 KB
/
Makefile
File metadata and controls
61 lines (48 loc) · 2.15 KB
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
SHELL := /bin/bash
include .env
include includes/gcloud.mk
include includes/iac.mk
include includes/dbt.mk
include includes/airbyte.mk
include includes/lightdash.mk
.EXPORT_ALL_VARIABLES:
.DEFAULT_GOAL := help
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# ---------------------------------------------------------------------------------------- #
# -- < Variables > --
# ---------------------------------------------------------------------------------------- #
# -- bucket definitions
DEPLOY_BUCKET := $(PROJECT)-gcs-deploy
# ---------------------------------------------------------------------------------------- #
# -- < Feedback > --
# ---------------------------------------------------------------------------------------- #
# -- display environment variables only on local environment
ifeq ($(RUN_FROM), local)
$(info $(shell printf "=%.s" $$(seq 100)))
$(info BILLING_ID = $(BILLING_ID))
$(info FOLDER_ID = $(FOLDER_ID))
$(info ORG_ID = $(ORG_ID))
$(info PROJECT = $(PROJECT))
$(info ZONE = $(ZONE))
$(info REGION = $(REGION))
$(info DEPLOY_BUCKET = $(DEPLOY_BUCKET))
$(info DBT_PROJECT = $(DBT_PROJECT))
$(info DBT_DATASET = $(DBT_DATASET))
$(info GITHUB_REPO = $(GITHUB_REPO))
$(info $(shell printf "=%.s" $$(seq 100)))
endif
help: ## Displays the current message
@awk -F ':.*?##' '/^[^\t].+?:.*?.*?##/ {printf "\033[36m%-30s\033[0m %s\n", $$1, $$NF}' $(MAKEFILE_LIST)
# ---------------------------------------------------------------------------------------- #
# This target will perform the complete setup of the current repository.
# ---------------------------------------------------------------------------------------- #
all: gcloud-init configure-docker dbt-deploy iac-clean iac-deploy ## Initializes the application (project creation, bucket creation, docker upload and iac deployment)
docker:
@docker build -t open-data-stack .
@docker run -it --rm --privileged \
--name open-data-stack_tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
--mount type=bind,source="$(ROOT_DIR)"/,target=/opt/app \
-p 8004:8002 \
-p 8005:8003 \
open-data-stack