-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.studiorc
46 lines (41 loc) · 1.13 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
#!/bin/bash
export HAB_CREATE_PACKAGE='true'
export HAB_HART_COMPRESSION_LEVEL=0
export HAB_NOCOLORING='true'
export HISTFILE='/src/.bash_history'
export TERM='xterm'
hab pkg install 'core/curl' --binlink
hab pkg install 'core/jq-static' --binlink
svc() {
local action=$1
for plan_path in $2
do
unset pkg_svc_run_flags
source "${plan_path}/plan.sh"
hab origin key download "${pkg_origin}"
hab origin key download --secret "${pkg_origin}"
hab svc unload "${pkg_origin}/${pkg_name}"
build "${plan_path}"
source './results/last_build.env'
hab pkg install "./results/${pkg_artifact}"
if [ $action == 'run' ]
then
hab sup run "${pkg_origin}/${pkg_name}" ${pkg_svc_run_flags}
elif [ $action == 'load' ]
then
hab svc load "${pkg_origin}/${pkg_name}" ${pkg_svc_run_flags}
fi
done
return $?
}
svc_group() {
pkg_ident=$1
hab svc status | grep ${pkg_ident} | grep -v "^package" | awk '{print $7}'
return $?
}
svc_group_cfg() {
group=$(svc_group $1)
group_path=$(echo -n ${group} | sed 's@\.@/@')
curl --silent "localhost:9631/services/${group_path}" | jq '.cfg'
return $?
}