-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplatform-test.mak
84 lines (65 loc) · 2.18 KB
/
platform-test.mak
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Platform Test Makefile
#
# This Makefile is used to test the platform.
# We avoided calling it `Makefile` in order to avoid conflicting with the
# Makefile that comes with the platform in `template-infra`
.PHONY = \
clean \
clean-infra \
install-infra \
install-flask \
install-nextjs
# The git ref to use to upgrade from
UPGRADE_REF ?= $(shell git rev-parse --abbrev-ref HEAD)
clean: clean-app clean-infra
# The git branch to checkout
# Set to `main` by default
BRANCH ?= main
install-infra:
# fetch latest version of template-infra
git clone --single-branch --branch $(BRANCH) --depth 1 [email protected]:navapbc/template-infra.git
# copy over template files
cp -r \
template-infra/.github \
template-infra/bin \
template-infra/docs \
template-infra/infra \
template-infra/Makefile \
.
rm .github/workflows/template-only-*
# clean up template-infra folder
rm -fr template-infra
install-application-nextjs:
# fetch latest version of template-application-nextjs
git clone --single-branch --branch $(BRANCH) --depth 1 [email protected]:navapbc/template-application-nextjs.git
# copy app decision records
mkdir -p docs/
cp -r template-application-nextjs/docs/decisions/ docs/decisions/
# copy app code
cp -r template-application-nextjs/app/ app/
# clean up template-application-nextjs folder
rm -fr template-application-nextjs
install-application-flask:
# fetch latest version of template-application-flask
git clone --single-branch --branch $(BRANCH) --depth 1 [email protected]:navapbc/template-application-flask.git
# copy app decision records
mkdir -p docs/
cp -r template-application-flask/docs/decisions/ docs/decisions/
# copy app code
cp -r template-application-flask/app/ app/
# clean up template-application-flask folder
rm -fr template-application-flask
upgrade-infra-modules:
git clone --single-branch --branch $(UPGRADE_REF) --depth 1 [email protected]:navapbc/template-infra.git
cp -r template-infra/infra/modules infra/
cp -r template-infra/infra/test infra/
cp -r template-infra/infra/app/env-template/ infra/app/env-template/
rm -fr template-infra
clean-app:
rm -fr app/
clean-infra:
rm -fr infra/
rm -fr bin/
rm -fr docs/
rm -fr .github/
rm Makefile