aboutsummaryrefslogtreecommitdiffstats
path: root/jenkins-common.sh
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-30 08:11:47 +0200
committerOliver Smith <osmith@sysmocom.de>2020-05-30 08:57:58 +0200
commit061efaf6e647d7b23d18765e932713d2503f8663 (patch)
tree48411756788a64b3cbdc039964bcf0fedd9c0668 /jenkins-common.sh
parent95bb9e5cb08b07c0deff68a4a87b67553adfa88b (diff)
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
Diffstat (limited to 'jenkins-common.sh')
-rw-r--r--jenkins-common.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/jenkins-common.sh b/jenkins-common.sh
index 01f23d0..ea03d52 100644
--- a/jenkins-common.sh
+++ b/jenkins-common.sh
@@ -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