From b1d54cb5a3bb1fa5a9db2430e806d7d7b3cfcba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Suchomel?= Date: Fri, 15 Feb 2019 11:55:00 +0100 Subject: [PATCH] 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 --- openstack/loci/build.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openstack/loci/build.sh b/openstack/loci/build.sh index bacf501e..ddcdc39d 100755 --- a/openstack/loci/build.sh +++ b/openstack/loci/build.sh @@ -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 _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