-
Notifications
You must be signed in to change notification settings - Fork 1
/
duck-tape.mk
65 lines (52 loc) · 1.17 KB
/
duck-tape.mk
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
DIST = ./dist
.ifndef DT_BASE
DT_BASE = "/"
.endif
.ifndef DT_HOST
.error "DT_HOST is not defined. Hej då."
.endif
.ifndef DT_DEST
.error "DT_DEST is not defined. Hej då."
.endif
dtbuild:
@mkdir -p src images templates views
@rsync -r src ${DIST}/
@rsync -r images ${DIST}/
@rsync -r templates ${DIST}/
@rsync -r views/ ${DIST}
@echo '{}' \
| jq '.api = ${DT_API}' \
| jq '.logo = ${DT_LOGO}' \
| jq '.auth_server = ${AUTH_SERVER}' \
| jq '.auth_world = ${AUTH_WORLD}' \
| jq '.production = ${DT_PRODUCTION}' \
| jq '.upload = ${DT_UPLOAD}' \
| jq '.src = ${DT_SRC}' \
| jq '.base = ${DT_BASE}' \
| jq '.project = ${DT_PROJECT}' \
> tmpconfig
@cat tmpconfig | jq
@touch src/config-extras.js
@printf "%s" "export const config = " | \
cat - tmpconfig \
src/config-extras.js \
> ${DIST}/config.js
@rm -f tmpconfig
dtsync:
@rsync -OPvr \
--copy-links \
--checksum \
--delete-after \
${DIST}/ \
${DT_HOST}:${DT_DEST}
dtsynced:
@rsync -OPr \
--info=FLIST0 \
--dry-run \
--copy-links \
--checksum \
--delete-after \
${DIST}/ \
${DT_HOST}:${DT_DEST}
dtdeploy: envpatchreverse dtbuild dtsync envpatch
bmake dtbuild env=development