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 <davlet.panech@windriver.com>
Change-Id: Ic3647b4364d1294b5b99033c4fb66a8fce5da630
This commit is contained in:
Davlet Panech 2022-03-31 16:02:40 -04:00
parent 136c7853ff
commit 12744ee165

View File

@ -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