vm_setup: Don't perform checkout directly in spdk repo

Perform it inside the a copy instead.

Also, don't copy the repo if target directory already exists.

Change-Id: Icdff80c978c7a8998b113db27bf744503bb29d0f
Signed-off-by: Michal Berger <michalx.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2737
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Mellanox Build Bot
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
Michal Berger 2020-06-02 11:02:28 +02:00 committed by Tomasz Zawadzki
parent c943701c7d
commit 4290d218f6

View File

@ -7,11 +7,14 @@ function install_refspdk() {
# Create a reference SPDK build for ABI tests # Create a reference SPDK build for ABI tests
git -C spdk_repo/spdk fetch --tags git -C spdk_repo/spdk fetch --tags
last_release=$(git -C spdk_repo/spdk tag | sort --version-sort | grep -v rc | tail -n1) last_release=$(git -C spdk_repo/spdk tag | sort --version-sort | grep -v rc | tail -n1)
git -C spdk_repo/spdk checkout $last_release
git -C spdk_repo/spdk submodule update --init
output_dir="$HOME/spdk_$(tr . _ < <(tr -d '[:alpha:]' <<< $last_release))" output_dir="$HOME/spdk_$(tr . _ < <(tr -d '[:alpha:]' <<< $last_release))"
cp -r spdk_repo/spdk $output_dir if [[ ! -d $output_dir ]]; then
cp -r spdk_repo/spdk "$output_dir"
fi
git -C "$output_dir" checkout "$last_release"
git -C "$output_dir" submodule update --init
cat > $HOME/autorun-spdk.conf <<- EOF cat > $HOME/autorun-spdk.conf <<- EOF
SPDK_BUILD_SHARED_OBJECT=1 SPDK_BUILD_SHARED_OBJECT=1