-
Notifications
You must be signed in to change notification settings - Fork 3
/
.studiorc
78 lines (55 loc) · 1.47 KB
/
.studiorc
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
#!/bin/bash
SITE_HOST="http://datagit.dev01.slatepowered.net"
# install dependencies
echo
echo "--> Installing project development dependencies..."
hab pkg install \
jarvus/mkdocs-studio \
jarvus/studio-toolkit \
core/node \
jarvus/cadaver
hab pkg binlink core/node
hab pkg binlink core/coreutils env --dest /usr/bin
# echo
# echo "--> Bootstrapping project"
# [ -z "${SKIP_NPM_INSTALL}" ] && (cd /src && npm ci)
# load studio toolkit
source "$(hab pkg path jarvus/studio-toolkit)/studio.sh"
# load MkDocs studio
export DOCS_HOLOBRANCH="docs-site"
source "$(hab pkg path jarvus/mkdocs-studio)/studio.sh"
echo
echo "--> Setting up studio commands"
npm-run() {
pushd /src > /dev/null
hab pkg exec core/node npm run "$@"
popd > /dev/null
}
STUDIO_HELP[serve]="Build and launch a hot-reloading web server"
serve() {
npm-run serve
}
STUDIO_HELP[build]="Compile and minify for production"
build() {
npm-run build
}
STUDIO_HELP[publish]="Build and upload to \$SITE_HOST [${SITE_HOST}]"
publish() {
rm -rf /src/dist
npm-run build
pushd /src/dist > /dev/null
hab pkg exec jarvus/cadaver \
cadaver-put-recursive \
. \
"${SITE_HOST}/develop/site-root"
popd > /dev/null
}
## final init and output
studio-help
echo
echo "--> Developer studio ready!"
echo " If you're on Mac or Windows, be sure you opened port 8080 through Docker:"
echo
echo " export HAB_DOCKER_OPTS='-p 8080:8080'"
# final blank line
echo