From 5b62b7ef1e7076ea330b37d922de12a1ef107b06 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Wed, 6 Dec 2023 11:21:36 -0500 Subject: [PATCH] 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 Change-Id: I367a6db9503a13d376966376a8b25cbedccd1f35 --- stx-init-env | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/stx-init-env b/stx-init-env index d1bdc5df..479979c4 100755 --- a/stx-init-env +++ b/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"