-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.studiorc
62 lines (50 loc) · 937 Bytes
/
.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
RED='\033[0;31m'
NO_COLOR='\033[0m'
install-packages() {
hab pkg install \
core/cacerts \
core/net-tools \
core/procps-ng \
core/curl \
-b -c stable
}
no_install_deps() {
local file="/src/cleanup"
if [ ! -f "$file" ]; then
touch "$file"
else
echo "1"
fi
}
# Cleanup any development touch files we laid down when checking to see if we could run NO_INSTALL_DEPS
_cleanup() {
if [ -f "/src/cleanup" ]; then
rm "/src/cleanup"
fi
}
start-demo() {
start-cache
start-datastore
start-api
}
start-datastore() {
hab svc load core/postgresql
}
start-api() {
hab svc load edavis/builder --bind datastore:postgresql.default
}
stop-api() {
hab svc unload edavis/builder
}
build-builder() {
stop-api
NO_INSTALL_DEPS=$(no_install_deps "builder-$component") \
build ./habitat-dev
start-api
}
start-cache() {
hab svc load core/sccache
}
trap _cleanup EXIT
install-packages
start-demo