forked from gestaogovbr/Ro-dou
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (30 loc) · 1.12 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
.PHONY: install-deps
install-deps:
git clone https://github.com/economiagovbr/FastETL.git
.PHONY: run
run: setup-containers create-example-variable
setup-containers:
docker-compose up -d --force-recreate --remove-orphans
create-example-variable:
@echo 'Waiting for Airflow API to start ...'
@docker exec airflow-webserver sh -c "while ! curl -f -s -LI 'http://localhost:8080/' > /dev/null; do sleep 5; done;"
@echo "Creating 'termos_exemplo_variavel' Airflow variable"
@docker exec airflow-webserver sh -c \
"if ! curl -f -s -LI 'http://localhost:8080/api/v1/variables/termos_exemplo_variavel' --user \"airflow:airflow\" > /dev/null; \
then \
curl -s -X 'POST' \
'http://localhost:8080/api/v1/variables' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
--user \"airflow:airflow\" \
-d '{ \
\"key\": \"termos_exemplo_variavel\", \
\"value\": \"LGPD\nlei geral de proteção de dados\nacesso à informação\" \
}' > /dev/null; \
fi"
.PHONY: down
down:
docker-compose down
.PHONY: tests
tests:
docker exec airflow-webserver sh -c "cd /opt/airflow/tests/ && pytest -vvv --color=yes"