stx-init-env: new option --no-start
New option to skip (re-)starting the pods. This will allow us to better control build stages in Jenkins. TESTS ===================== Run with and without the new option Story: 2010226 Task: 49211 Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: I367a6db9503a13d376966376a8b25cbedccd1f35
This commit is contained in:
parent
fa8836f10b
commit
5b62b7ef1e
26
stx-init-env
26
stx-init-env
|
@ -29,6 +29,8 @@ Initialize StarlingX build environment & (re-)start builder pods
|
|||
execute "docker login" prior to building or pulling builder
|
||||
images
|
||||
|
||||
--no-start Refresh builder images, but don't (re-)start pods
|
||||
|
||||
END
|
||||
}
|
||||
|
||||
|
@ -68,6 +70,7 @@ DELETE_ENV=0
|
|||
RESTART_MINIKUBE=0
|
||||
CLEAN_CONFIG=0
|
||||
USE_DOCKER_CACHE=0
|
||||
START_PODS=1
|
||||
|
||||
minikube_started() {
|
||||
local result
|
||||
|
@ -116,7 +119,7 @@ cmdline_error() {
|
|||
}
|
||||
|
||||
# process command line
|
||||
temp=$(getopt -o hR --long help,clean,restart-minikube,rebuild::,cache,nuke,dockerhub-login -n "$PROGNAME" -- "$@") || cmdline_error
|
||||
temp=$(getopt -o hR --long help,clean,restart-minikube,rebuild::,cache,nuke,dockerhub-login,no-start -n "$PROGNAME" -- "$@") || cmdline_error
|
||||
eval set -- "$temp"
|
||||
while true ; do
|
||||
case "$1" in
|
||||
|
@ -164,6 +167,10 @@ while true ; do
|
|||
DOCKERHUB_LOGIN=1
|
||||
shift
|
||||
;;
|
||||
--no-start)
|
||||
START_PODS=0
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
|
@ -364,11 +371,14 @@ if [[ -n "$PULL_DOCKER_IMAGES" ]] ; then
|
|||
fi
|
||||
|
||||
# Restart pods
|
||||
notice "Restarting pods"
|
||||
stx control stop || exit 1
|
||||
stx config --upgrade || exit 1
|
||||
# FIXME: inject docker hub credentials into k8s
|
||||
# FIXME: inject docker hub credentials into builder pod
|
||||
stx control start || exit 1
|
||||
if [[ $START_PODS -eq 1 ]] ; then
|
||||
notice "Restarting pods"
|
||||
stx control stop || exit 1
|
||||
stx config --upgrade || exit 1
|
||||
# FIXME: inject docker hub credentials into k8s
|
||||
# FIXME: inject docker hub credentials into builder pod
|
||||
stx control start || exit 1
|
||||
|
||||
notice "Run 'stx control status' to check the pod startup status"
|
||||
fi
|
||||
|
||||
notice "Run 'stx control status' to check the pod startup status"
|
||||
|
|
Loading…
Reference in New Issue