docker_images_require: build depends too
Add a function to automatically resolve the most common dependencies, osmo-* need debian-stretch-build and ttcn3-* need debian-stretch-titan. Do this in a shell function in jenkins-common.sh, so we can extend it in the next patch with distribution specific dependencies (osmo-*-centos8 needs centos8-build). Related: OS#4564 Change-Id: I98760c6dc3206529c0e267338c9f6f8e1d5be33a
This commit is contained in:
parent
95bb9e5cb0
commit
061efaf6e6
|
@ -2,12 +2,26 @@ docker_image_exists() {
|
|||
test -n "$(docker images -q "$REPO_USER/$1")"
|
||||
}
|
||||
|
||||
docker_depends() {
|
||||
case "$1" in
|
||||
osmo-*) echo "debian-stretch-build" ;;
|
||||
ttcn3-*) echo "debian-stretch-titan" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
docker_images_require() {
|
||||
local i
|
||||
local from_line
|
||||
local pull_arg
|
||||
local depends
|
||||
|
||||
for i in $@; do
|
||||
# Build dependencies first
|
||||
depends="$(docker_depends "$i")"
|
||||
if [ -n "$depends" ]; then
|
||||
docker_images_require $depends
|
||||
fi
|
||||
|
||||
# Trigger image build (cache will be used when up-to-date)
|
||||
if [ -z "$NO_DOCKER_IMAGE_BUILD" ]; then
|
||||
# Pull upstream base images
|
||||
|
|
Loading…
Reference in New Issue