aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-01-14 14:43:00 +0100
committerOliver Smith <osmith@sysmocom.de>2020-01-15 10:19:13 +0100
commitd0418d0f92b2cf73932c068f50bb55f90b78137b (patch)
tree4778db770a5dce03bc7847a9d8f302f1011fac3c /scripts
parent51e91cd9bbc049216cca6bbf4ce525f30fdb10fa (diff)
docker_images_require: add symlink code path
Make development easier by skipping fetch, checkout and reset --hard if _docker_playground is a symlink. Document _docker_playground in README.adoc and explain how to set up the symlink. Change-Id: If6209ff71488d39e590f5f8506b9d73ad0314846
Diffstat (limited to 'scripts')
-rw-r--r--scripts/common.sh26
1 files changed, 16 insertions, 10 deletions
diff --git a/scripts/common.sh b/scripts/common.sh
index 6d28cfc..340bac8 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -117,18 +117,24 @@ osmo_source_subdir() {
docker_images_require() {
local oldpwd="$PWD"
- # Get docker-plaground.git
- if [ -d "_docker_playground" ]; then
- git -C _docker_playground fetch
+ if [ -L "_docker_playground" ]; then
+ echo "NOTE: _docker_playground is a symlink, skipping fetch, checkout, reset"
+ cd "_docker_playground/$1"
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"
+ # 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"
+ # jenkins-common.sh expects to run from a subdir in docker-playground.git
+ cd "$1"
+ fi
# Subshell: run docker_images_require from jenkins-common.sh, pass all arguments
(. ../jenkins-common.sh; docker_images_require "$@")