
Separate the build step from startup for environment containers. Build step is very slow, and we want to be able to start the containers without rebuilding when troubleshooting Jenkins jobs. TESTS ============================== Run both steps from Jenkins Story: 2010226 Task: 49212 Depends-On: https://review.opendev.org/c/starlingx/tools/+/902792 Signed-off-by: Davlet Panech <davlet.panech@windriver.com> Change-Id: I3462de0a9550310c931cbed2555de1b3a6bc53f9
38 lines
800 B
Bash
Executable File
38 lines
800 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
set -e
|
|
source $(dirname "$0")/lib/job_utils.sh
|
|
|
|
require_job_env BUILD_HOME
|
|
require_job_env REBUILD_BUILDER_IMAGES
|
|
require_job_env USE_DOCKER_CACHE
|
|
|
|
set -x
|
|
load_build_env
|
|
|
|
# Check whether we need to login to docker hub
|
|
dockerhub_login=
|
|
for spec in $DOCKER_REGISTRY_LOGIN_LIST ; do
|
|
if [[ "$(parse_docker_registry "$spec" | awk '{print $1}')" == "docker.io" ]] ; then
|
|
dockerhub_login="--dockerhub-login"
|
|
break
|
|
fi
|
|
done
|
|
|
|
# build or download containers
|
|
cache_opts=
|
|
if $BUILDER_USE_DOCKER_CACHE ; then
|
|
cache_opts="--cache"
|
|
fi
|
|
rebuild_opts=
|
|
if $REBUILD_BUILDER_IMAGES ; then
|
|
rebuild_opts="--rebuild"
|
|
fi
|
|
./stx-init-env $rebuild_opts $cache_opts --no-start $dockerhub_login
|