-
Notifications
You must be signed in to change notification settings - Fork 126
/
Copy pathMakefile
35 lines (28 loc) · 1.03 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: build deploy smoke_test
EXAMPLE_TAR_OUTPUT = $(abspath ./example_project.tar)
EXAMPLE_PROJECT_JSON = $(abspath ./example_projects/example-project.json)
EXAMPLE_PROJECT_POSTGRES_JSON = $(abspath ./example_projects/example-project-postgres.json)
PROJECT_NAME=`cat ${EXAMPLE_PROJECT_JSON} | jq -r '.name'`
deploy:
ifeq "$(name)" ""
@echo "Specify name e.g. make deploy name=staging" && exit 1
else
firebase use $(name)
yarn run build_$(name)
rm -rf dist_$(name)
mkdir -p dist_$(name)
cp -r packages/djangobuilder.io/dist/* dist_$(name)/
mkdir -p dist_$(name)/db4/
cp -r packages/djangobuilder4/dist/* dist_$(name)/db4/
firebase deploy --public=dist_$(name)
endif
smoke_test:
./script/cli_test.sh ${EXAMPLE_PROJECT_JSON}
smoke_test_postgres:
./script/cli_test.sh ${EXAMPLE_PROJECT_POSTGRES_JSON} start_docker
smoke_test_postgres_ci:
./script/cli_test.sh ${EXAMPLE_PROJECT_POSTGRES_JSON}
create:
yarn run cli ${EXAMPLE_PROJECT_JSON} ${EXAMPLE_TAR_OUTPUT}
echo "Project created at ${PROJECT_NAME}"
tar -xvf ${EXAMPLE_TAR_OUTPUT}