Added some checks for the case 'requirement' is not part of BUILD_PROJECTS

If requirements is not part of BUILD_PROJECTS, assume it was built already
before and set the REQUIREMENTS_TAGGED_PROJECT_REF according to current project.
Otherwise there'd be WHEELS set to something like "requirements:version--distro"

Change-Id: Ifedd3b41a52b4e9628c1b4ec07176b5e3416dbb7
This commit is contained in:
Jiří Suchomel 2019-02-15 11:55:00 +01:00 committed by Chris Wedgwood
parent 1d2bce87f0
commit b1d54cb5a3
1 changed files with 12 additions and 4 deletions

View File

@ -104,6 +104,12 @@ function get_project_image_build_arguments {
build_args="${build_args} --build-arg GID=${!this_gid}"
fi
# If requirements was not part of BUILD_PROJECTS, assume it was
# built before and set the project ref based on current project
if [[ -z ${REQUIREMENTS_TAGGED_PROJECT_REF} ]]; then
REQUIREMENTS_TAGGED_PROJECT_REF=${TAGGED_PROJECT_REF}
fi
#Point to requirement wheels, or use <project>_wheels
# if defined.
local this_wheels="${project}_wheels"
@ -258,10 +264,12 @@ projects=( ${BUILD_PROJECTS} )
pushd ${LOCI_SRC_DIR}
# The first project should be requirements, if requirements is built.
# This one should not be run in parallel.
get_project_image_build_arguments ${projects[0]}
eval "${docker_build_cmd}"
docker push ${tag}
unset projects[0]
if [[ "${projects[0]}" == "requirements" ]]; then
get_project_image_build_arguments ${projects[0]}
eval "${docker_build_cmd}"
docker push ${tag}
unset projects[0]
fi
# clear action from previous install (can be in dev local builds)
truncate -s 0 ${LOG_PREFIX}actions
# Run the rest of the projects with parallel