Jenkins connection script needs to be run from $jenkinshome 73/18873/1
authorAric Gardner <agardner@linuxfoundation.org>
Wed, 17 Aug 2016 19:02:27 +0000 (15:02 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Wed, 17 Aug 2016 19:03:10 +0000 (15:03 -0400)
Exit if script is run from the wrong directory

Change-Id: I693ab65b4439c5b4d3b609e95295fa43e8cd3a58
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
utils/jenkins-jnlp-connect.sh

index 8dcaf35..4b710ca 100755 (executable)
@@ -38,6 +38,11 @@ main () {
         exit 1
     fi
 
+    if [[ $(pwd) != "$jenkinshome" ]]; then
+        echo "This script needs to be run from the jenkins users home dir"
+        exit 1
+    fi
+
     if [[ -z $slave_name || -z $slave_secret ]]; then
         echo "slave name or secret not defined, please edit this file to define it"
         exit 1