Ensure DIB_REPOREF_amphora_agent is set

This patch ensure that the proper git format is used based on
the git version, i.e., if the git version is below 1.8.5, it
forces to use git -c -- since -C option is not available.
Otherwise it used git -C.

Change-Id: I9522765fae633f096c095a60f470467c0ff221c0
Story: 2001204
Task: 5709
This commit is contained in:
Luis Tomas Bolivar 2017-09-19 17:03:07 +02:00
parent 27735576fd
commit 3e3416113e
1 changed files with 7 additions and 1 deletions

View File

@ -54,7 +54,13 @@ function build_octavia_worker_image {
export DIB_REPOLOCATION_pip_and_virtualenv=file://$GET_PIP_CACHE_LOCATION
fi
export DIB_REPOLOCATION_amphora_agent=$OCTAVIA_DIR
export DIB_REPOREF_amphora_agent=$(git -C "$OCTAVIA_DIR" log -1 --pretty="format:%H")
git_minimum_version=$(git --version | awk '{print $NF "\n1.8.5" }' | sort -V | head -1)
if [[ ${git_minimum_version} == "1.8.5" ]]; then
export DIB_REPOREF_amphora_agent=$(git -C "$OCTAVIA_DIR" log -1 --pretty="format:%H")
else
export DIB_REPOREF_amphora_agent=$(git -c "$OCTAVIA_DIR" log -1 --pretty="format:%H")
fi
TOKEN=$(openstack token issue | grep ' id ' | get_field 2)
die_if_not_set $LINENO TOKEN "Keystone failed to get token."