From 12744ee1658e38806d1b706ecea71713336d96e1 Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Thu, 31 Mar 2022 16:02:40 -0400 Subject: [PATCH] debian: don't call repo sync automatically Currently "stx build prepare" is required opon (re-)starting builder pods; that command always calls "repo sync", which may trigger git merge's and upgrade the current source tree, disrupting any uncommitted work. Solution: call "stx build prepare" only when the source tree doesn't exist (ie the very first time). TESTS ===== Re-start pods, then call "stx build prepare" twice. Make sure first call invokes "repo sync", and subsequent calls don't. Story: 2008846 Task: 44910 Signed-off-by: Davlet Panech Change-Id: Ic3647b4364d1294b5b99033c4fb66a8fce5da630 --- .../stx-builder/configmap/stx-prepare-build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/stx/stx-build-tools-chart/stx-builder/configmap/stx-prepare-build b/stx/stx-build-tools-chart/stx-builder/configmap/stx-prepare-build index 90d4441e..c78cabcd 100755 --- a/stx/stx-build-tools-chart/stx-builder/configmap/stx-prepare-build +++ b/stx/stx-build-tools-chart/stx-builder/configmap/stx-prepare-build @@ -17,11 +17,17 @@ if [[ x"$PROXY" == x"true" ]]; then ssh -D 8080 -qTfnN $HOSTUSERNAME@$PROXYSERVER fi - proxychains repo init -u https://opendev.org/starlingx/manifest -b $BUILD_BRANCH -m ${MANIFEST} - proxychains repo sync --force-sync + if [[ ! -f .repo-init-done ]] ; then + proxychains repo init -u https://opendev.org/starlingx/manifest -b $BUILD_BRANCH -m ${MANIFEST} && \ + proxychains repo sync --force-sync && \ + touch .repo-init-done + fi else - repo init -u https://opendev.org/starlingx/manifest -b $BUILD_BRANCH -m ${MANIFEST} - repo sync --force-sync + if [[ ! -f .repo-init-done ]] ; then + repo init -u https://opendev.org/starlingx/manifest -b $BUILD_BRANCH -m ${MANIFEST} && \ + repo sync --force-sync && \ + touch .repo-init-done + fi fi sudo apt-get update