Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Helm
Commits
711f6431
Commit
711f6431
authored
9 years ago
by
Adam Reese
Browse files
Options
Download
Email Patches
Plain Diff
fix(devtools): refactor local run script
parent
6ea146ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/start.sh
+52
-33
scripts/start.sh
with
52 additions
and
33 deletions
+52
-33
scripts/start.sh
+
52
-
33
View file @
711f6431
#!/bin/bash
set
-eo
pipefail
KUBE_PROXY
=
${
KUBE_PROXY
:-}
KUBE_PROXY_PORT
=
${
KUBE_PROXY_PORT
:-
8001
}
MANAGER_PORT
=
${
MANAGER_PORT
:-
8080
}
RESOURCIFIER
=
bin/resourcifier
EXPANDYBIRD
=
bin/expandybird
MANAGER
=
bin/manager
error_exit
()
{
# Display error message and exit
echo
"error:
${
1
:-
"unknown error"
}
"
1>&2
exit
1
}
require_binary_exists
()
{
if
!
command
-v
"
$1
"
>
/dev/null 2>&1
;
then
error_exit
"Cannot find binary for
$1
. Build binaries by running 'make build'"
fi
}
for
b
in
$RESOURCIFIER
$EXPANDYBIRD
$MANAGER
;
do
require_binary_exists
$b
# kill if currently running
pkill
-f
$b
done
LOGDIR
=
log
if
[[
!
-d
$LOGDIR
]]
;
then
mkdir
$LOGDIR
fi
KUBECTL
=
`
which kubectl
`
if
[[
-z
$KUBECTL
]]
;
then
echo
Cannot find kubectl
exit
1
fi
KUBECTL
=
$(
which kubectl
)
||
error_exit
"Cannot find kubectl"
echo
"Starting resourcifier..."
RESOURCIFIER
=
bin/resourcifier
if
[[
-z
$RESOURCIFIER
]]
;
then
echo
Cannot find resourcifier
exit
1
fi
pkill
-f
$RESOURCIFIER
nohup
$RESOURCIFIER
>
$LOGDIR
/resourcifier.log 2>&1
--kubectl
=
$KUBECTL
--port
=
8082 &
echo
nohup
$RESOURCIFIER
>
$LOGDIR
/resourcifier.log 2>&1
--kubectl
=
"
${
KUBECTL
}
"
--port
=
8082 &
echo
"Starting expandybird..."
EXPANDYBIRD
=
bin/expandybird
if
[[
-z
$EXPANDYBIRD
]]
;
then
echo
Cannot find expandybird
exit
1
fi
pkill
-f
$EXPANDYBIRD
nohup
$EXPANDYBIRD
>
$LOGDIR
/expandybird.log 2>&1
--port
=
8081
--expansion_binary
=
expansion/expansion.py &
echo
echo
"Starting deployment manager..."
MANAGER
=
bin/manager
if
[[
-z
$MANAGER
]]
;
then
echo
Cannot find manager
exit
1
nohup
$MANAGER
>
$LOGDIR
/manager.log 2>&1
--port
=
"
${
MANAGER_PORT
}
"
--kubectl
=
"
${
KUBECTL
}
"
--expanderURL
=
http://localhost:8081
--deployerURL
=
http://localhost:8082 &
if
[[
"
$KUBE_PROXY
"
]]
;
then
echo
"Starting kubectl proxy..."
pkill
-f
"
$KUBECTL
proxy"
nohup
"
$KUBECTL
"
proxy
--port
=
"
${
KUBE_PROXY_PORT
}
"
&
sleep
1s
fi
pkill
-f
$MANAGER
nohup
$MANAGER
>
$LOGDIR
/manager.log 2>&1
--port
=
8080
--kubectl
=
$KUBECTL
--expanderURL
=
http://localhost:8081
--deployerURL
=
http://localhost:8082 &
echo
echo
"Starting kubectl proxy..."
pkill
-f
"
$KUBECTL
proxy"
nohup
$KUBECTL
proxy
--port
=
8001 &
sleep
1s
echo
cat
<<
EOF
Local manager server is now running on :
${
MANAGER_PORT
}
Logging to
${
LOGDIR
}
To use helm:
export HELM_HOST=http://localhost:
${
MANAGER_PORT
}
./bin/helm list
To deploy example guestbook:
./bin/dm -service=http://localhost:8088 deploy examples/guestbook/guestbook.yaml
echo
"Done."
EOF
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help