Change in ...osmo-ci[master]: common.sh: add docker_images_require

osmith gerrit-no-reply at lists.osmocom.org
Wed Jul 3 11:40:10 UTC 2019


osmith has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/osmo-ci/+/14652 )

Change subject: common.sh: add docker_images_require
......................................................................

common.sh: add docker_images_require

Clone docker-playground.git, source its jenkins-common.sh and run
docker_images_require from there. This will make it possible to run
osmocom-release-tarballs.sh in a docker container, for which the
Dockerfile is stored in docker-playground.git.

Related: OS#3870
Change-Id: Ic4519ccb6978793054869862f8ca0e21d9cf5be4
---
M .gitignore
M scripts/common.sh
2 files changed, 27 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved; Verified



diff --git a/.gitignore b/.gitignore
index ff207ee..459f2c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,7 @@
 _temp/
 _deps/
 _release_tarballs/
+_docker_playground
 
 # osmocom-nightly-packages.sh
 nightly-3g_*
diff --git a/scripts/common.sh b/scripts/common.sh
index 2cf31a5..bf24fc4 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -27,6 +27,8 @@
 	osmocom-bb
 "
 
+OSMO_BRANCH_DOCKER_PLAYGROUND="${OSMO_BRANCH_DOCKER_PLAYGROUND:-master}"
+
 # Print commit of HEAD for an Osmocom git repository, e.g.:
 # "f90496f577e78944ce8db1aa5b900477c1e479b0"
 # $1: repository
@@ -96,3 +98,27 @@
 			;;
 	esac
 }
+
+# Build docker images from docker-playground.git.
+# $1...$n: docker image names (e.g. "debian-stretch-build")
+docker_images_require() {
+	local oldpwd="$PWD"
+
+	# Get docker-plaground.git
+	if [ -d "_docker_playground" ]; then
+		git -C _docker_playground fetch
+	else
+		git clone https://git.osmocom.org/docker-playground/ _docker_playground
+	fi
+	cd _docker_playground
+	git checkout "$OSMO_BRANCH_DOCKER_PLAYGROUND"
+	git reset --hard "origin/$OSMO_BRANCH_DOCKER_PLAYGROUND"
+
+	# jenkins-common.sh expects to run from a subdir in docker-playground.git
+	cd "$1"
+
+	# Subshell: run docker_images_require from jenkins-common.sh, pass all arguments
+	(. ../jenkins-common.sh; docker_images_require "$@")
+
+	cd "$oldpwd"
+}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/14652
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ic4519ccb6978793054869862f8ca0e21d9cf5be4
Gerrit-Change-Number: 14652
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190703/9c130645/attachment.html>


More information about the gerrit-log mailing list