-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (49 loc) · 2.02 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
.PHONEY: build run run_ci with_production
TAG = navigator-frontend
THEME ?= cclw
API_URL ?= https://app.dev.climatepolicyradar.org/api/v1
S3_PATH ?= https://cpr-staging-targets-json-store.s3.eu-west-1.amazonaws.com
ADOBE_API_KEY ?= dca9187b65294374a6367824df902fdf
NEXT_PUBLIC_APP_TOKEN ?= eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhbGxvd2VkX2NvcnBvcmFfaWRzIjpbIkNDTFcuY29ycHVzLmkwMDAwMDAwMS5uMDAwMCIsIkNQUi5jb3JwdXMuaTAwMDAwMDAxLm4wMDAwIiwiVU5GQ0NDLmNvcnB1cy5pMDAwMDAwMDEubjAwMDAiXSwiZXhwIjoyMDQyMTEzMzY5LCJpYXQiOjE3MjY1NzY5NjksImlzcyI6IkNsaW1hdGUgUG9saWN5IFJhZGFyIiwic3ViIjoiQ1BSIiwiYXVkIjoiaHR0cHM6Ly9hcHAuZGV2LmNsaW1hdGVwb2xpY3lyYWRhci5vcmcvIn0.mJ2qLJmMyPLGt0rM_tTXhlVv1glxooxmQV0bWrvPwKU
build:
docker build --build-arg THEME=${THEME} -t ${TAG}-${THEME} .
run: build
docker run --rm -it \
-p 3000:3000 \
-e THEME=$(THEME) \
-e NEXT_PUBLIC_APP_TOKEN=$(NEXT_PUBLIC_APP_TOKEN) \
-e API_URL=$(API_URL) \
-e ADOBE_API_KEY=$(ADOBE_API_KEY) \
-e S3_PATH=$(S3_PATH) \
-e NODE_ENV="development" \
-e ROBOTS="false" \
-e HOSTNAME="http://localhost:3000" \
-v $(PWD):/opt/node_app/app \
${TAG}-${THEME} npm run dev
with_production:
make API_URL=https://api.climatepolicyradar.org/api/v1
run_ci:
docker run --rm -d \
-p 3000:3000 \
-e THEME=$(THEME) \
-e NEXT_PUBLIC_APP_TOKEN=$(NEXT_PUBLIC_APP_TOKEN) \
-e API_URL=$(API_URL) \
-e ADOBE_API_KEY=$(ADOBE_API_KEY) \
-e S3_PATH=$(S3_PATH) \
-e NODE_ENV="production" \
-e ROBOTS="false" \
-e HOSTNAME="http://localhost:3000" \
${TAG}-${THEME}
install_trunk:
$(eval trunk_installed=$(shell trunk --version > /dev/null 2>&1 ; echo $$? ))
ifneq (${trunk_installed},0)
$(eval OS_NAME=$(shell uname -s | tr A-Z a-z))
curl https://get.trunk.io -fsSL | bash
endif
uninstall_trunk:
sudo rm -if `which trunk`
rm -ifr ${HOME}/.cache/trunk
build_custom_app: ## Creates a directory for the custom app with the required files
. "${PWD}"/scripts/build-custom-app.sh
delete_custom_app: ## Deletes a custom app and its related files / directories
. "${PWD}"/scripts/delete-custom-app.sh