-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (48 loc) · 1.83 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
59
.PHONY: all install start test-ci publish
SHELL := /usr/bin/env bash
HELIUMCLI_PROJECTS ?= '["platform", "frontend", "ci-tests"]'
SKIP_UPDATE ?= 'false'
DEV_LOCAL_AWS_REGION ?= 'us-east-2'
PLATFORM ?= linux/arm64
all: install build start
install:
@python -m pip install -r requirements.txt
@HELIUMCLI_FORCE_FETCH=True HELIUMCLI_SKIP_UPDATE_PULL=True HELIUMCLI_PROJECTS=$(HELIUMCLI_PROJECTS) helium-cli update-projects
build: install
@rm -f projects/platform/.env
PLATFORM=$(PLATFORM) make -C projects/platform build-docker
PLATFORM=$(PLATFORM) make -C projects/frontend build-docker
start: build
cd projects/platform && ./bin/runserver
cd projects/frontend && ./bin/runserver
test-ci: build
@if [[ -z "${PLATFORM_EMAIL_HOST_USER}" ]] || \
[[ -z "${PLATFORM_EMAIL_HOST_PASSWORD}" ]] || \
[[ -z "${PLATFORM_TWILIO_ACCOUNT_SID}" ]] || \
[[ -z "${PLATFORM_TWILIO_AUTH_TOKEN}" ]] || \
[[ -z "${PLATFORM_TWILIO_SMS_FROM}" ]] || \
[[ -z "${CI_AWS_S3_ACCESS_KEY_ID}" ]] || \
[[ -z "${CI_AWS_S3_SECRET_ACCESS_KEY}" ]] || \
[[ -z "${CI_TWILIO_RECIPIENT_PHONE_NUMBER}" ]]; then \
echo "Set all env vars required to run CI tests end-to-end against a local Docker build: [\
PLATFORM_EMAIL_HOST_USER, \
PLATFORM_EMAIL_HOST_PASSWORD, \
PLATFORM_TWILIO_ACCOUNT_SID, \
PLATFORM_TWILIO_AUTH_TOKEN, \
PLATFORM_TWILIO_SMS_FROM, \
CI_AWS_S3_ACCESS_KEY_ID, \
CI_AWS_S3_SECRET_ACCESS_KEY, \
CI_TWILIO_RECIPIENT_PHONE_NUMBER]"; \
exit 1; \
fi
./projects/platform/bin/provision-dot-env.sh
make -C projects/frontend run-docker
make -C projects/platform run-docker
ENVIRONMENT=dev-local \
PROJECT_APP_HOST=http://localhost:3000 \
PROJECT_API_HOST=http://localhost:8000 \
AWS_REGION=$(DEV_LOCAL_AWS_REGION) \
make -C projects/ci-tests test
publish: install
make -C projects/platform publish-docker
make -C projects/frontend publish-docker