#!/bin/bash # # Copyright (c) 2022 Wind River Systems, Inc. # # SPDX-License-Identifier: Apache-2.0 # set -e source $(dirname "$0")/lib/job_utils.sh load_build_env require_job_env DOCKER_BASE_OS require_job_env BUILD_STREAM stable PLATFORM_IMAGE="stx-platformclients" APPLICATION_IMAGE="stx-openstackclients" notice "building remote CLI tarball" # Usage: filter_image IMAGE_NAME LIST_FILE filter_image() { \grep --no-filename -E "^([^#].*/)*$1:" "$2" | tail -n 1 } # Find images we built during this run full_platform_image= full_application_image= if [[ -f "$WORKSPACE_ROOT/std/build-images/images-debian-stable-versioned.lst" ]] ; then full_platform_image=$(filter_image "$PLATFORM_IMAGE" "$WORKSPACE_ROOT/std/build-images/images-debian-stable-versioned.lst") full_application_image=$(filter_image "$APPLICATION_IMAGE" "$WORKSPACE_ROOT/std/build-images/images-debian-stable-versioned.lst") fi build_args= if [[ "$full_platform_image" ]] ; then build_args+=" --platform-image $full_platform_image" else warn "docker image $PLATFORM_IMAGE not built, using default" fi if [[ "$full_application_image" ]] ; then build_args+=" --application-image $full_application_image" else warn "docker image $APPLICATION_IMAGE not built, using default" fi # Creates $MY_WORKSPACE/std/build-remote-cli/*.tgz stx_docker_cmd $DRY_RUN_ARG "\$MY_REPO/build-tools/build-remote-cli.sh $build_args"