Provide a different source repo for spice-html5

We are noticing some intermittence on the gitlab service that provides
the spice-html5 source code defined on the default location on LOCI at
[1]. This commit creates the possibility to override the SPICE_REPO
location so we can decide for each image if we want to use a different
source and ref for spice-html5.

This patch also defaults to the github mirror of spice-html5 for all stx
images.

[1] https://github.com/openstack/loci/blob/master/Dockerfile#L29

TEST PLAN
PASS Build stx-nova image with SPICE_REPO and SPICE_REF changed
PASS Build images with a mix of changed and unchanged
     .stable_docker_images WRT spice-html5 source

Depends-On: https://review.opendev.org/c/openstack/loci/+/823577
Closes-Bug: #1956173
Signed-off-by: Thiago Brito <thiago.brito@windriver.com>
Change-Id: I6872e42b08b2774666691b5dc4f0ff534160434a
This commit is contained in:
Thiago Brito 2022-01-05 16:01:12 -05:00
parent 530afeafab
commit 00bd632a68
1 changed files with 16 additions and 1 deletions

View File

@ -38,6 +38,7 @@ CLEAN=no
TAG_LATEST=no
TAG_LIST_FILE=
TAG_LIST_LATEST_FILE=
DEFAULT_SPICE_REPO=https://github.com/freedesktop/spice-html5.git
declare -a ONLY
declare -a SKIP
declare -i MAX_ATTEMPTS=1
@ -174,7 +175,7 @@ function get_git {
function get_loci {
# Use a specific HEAD of loci, to provide a stable builder
local LOCI_REF="f022ecba553903df3df72d3668e143e9eb9ceded"
local LOCI_REF="efccd0a853879ac6af6066eda09792d0d3afe9c0"
local LOCI_REPO="https://github.com/openstack/loci.git"
local ORIGWD=${PWD}
@ -336,6 +337,10 @@ function build_image_loci {
PYTHON3=$(source ${image_build_file} && echo ${PYTHON3})
local MIRROR_LOCAL
MIRROR_LOCAL=$(source ${image_build_file} && echo ${MIRROR_LOCAL})
local SPICE_REPO
SPICE_REPO=$(source ${image_build_file} && echo ${SPICE_REPO})
local SPICE_REF
SPICE_REF=$(source ${image_build_file} && echo ${SPICE_REF})
echo "Building ${LABEL}"
@ -433,6 +438,16 @@ function build_image_loci {
BUILD_ARGS+=(--build-arg PYTHON3="${PYTHON3}")
fi
if [ -n "${SPICE_REPO}" ]; then
BUILD_ARGS+=(--build-arg SPICE_REPO="${SPICE_REPO}")
else
BUILD_ARGS+=(--build-arg SPICE_REPO="${DEFAULT_SPICE_REPO}")
fi
if [ -n "${SPICE_REF}" ]; then
BUILD_ARGS+=(--build-arg SPICE_REF="${SPICE_REF}")
fi
local build_image_name="${USER}/${LABEL}:${IMAGE_TAG_BUILD}"
with_retries ${MAX_ATTEMPTS} docker build ${WORKDIR}/loci --no-cache \