prototypes: xci: xci-deploy.sh: Append trailing slash for rsync vars 77/36877/1
authorMarkos Chandras <mchandras@suse.de>
Mon, 3 Jul 2017 21:24:41 +0000 (22:24 +0100)
committerMarkos Chandras <mchandras@suse.de>
Mon, 3 Jul 2017 21:27:19 +0000 (22:27 +0100)
The 'synchronize' Ansible module uses rsync and for that we need
to indicate that we want to copy the contents of the development path
and not the development path itself. As such we need to ensure that a
trailing slash is always appended to the user variables but we need to
also ensure that we will not end up with double slashes.

Change-Id: I0103b754585931fa1dcd3966c52d7e4a8f2f63f6
Signed-off-by: Markos Chandras <mchandras@suse.de>
prototypes/xci/xci-deploy.sh

index 3a65983..a72c927 100755 (executable)
@@ -37,6 +37,15 @@ source "$XCI_PATH/config/${XCI_FLAVOR}-vars"
 # source xci configuration
 source $XCI_PATH/config/env-vars
 
+#-------------------------------------------------------------------------------
+# Sanitize local development environment variables
+#-------------------------------------------------------------------------------
+user_local_dev_vars=(OPNFV_RELENG_DEV_PATH OPNFV_OSA_DEV_PATH OPNFV_BIFROST_DEV_PATH)
+for local_user_var in ${user_local_dev_vars[@]}; do
+    [[ -n ${!local_user_var} ]] && export $local_user_var=${!local_user_var%/}/
+done
+unset user_local_dev_vars local_user_var
+
 #-------------------------------------------------------------------------------
 # Log info to console
 #-------------------------------------------------------------------------------