Merge "Fix bug in jenkins job testapi"
authorSerena Feng <feng.xiaowei@zte.com.cn>
Fri, 6 Jan 2017 08:36:16 +0000 (08:36 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Fri, 6 Jan 2017 08:36:16 +0000 (08:36 +0000)
jjb/releng/testapi-automate.yml
utils/jenkins-jnlp-connect.sh

index ad4623f..d96c5cd 100644 (file)
@@ -1,19 +1,21 @@
 - project:
     name: testapi-automate
-
-    project: 'releng'
-
     stream:
         - master:
             branch: '{stream}'
-
+            gs-pathname: ''
     jobs:
         - 'testapi-automate-{stream}'
+    project: 'releng'
 
 - job-template:
     name: 'testapi-automate-{stream}'
 
     parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
         - 'opnfv-build-defaults'
 
     scm:
index 8337684..9751a90 100755 (executable)
@@ -116,33 +116,33 @@ stop program = \"/bin/bash -c '/bin/kill \$(/bin/cat /var/run/$jenkinsuser/jenki
         fi
     fi
 
-if [[ $started_monit == "true" ]]; then
-    wget --timestamping https://build.opnfv.org/ci/jnlpJars/slave.jar && true
-    chown $jenkinsuser:$jenkinsuser slave.jar
-
-    if [[ -f /var/run/$jenkinsuser/jenkins_jnlp_pid ]]; then
-        echo "pid file found"
-        if ! kill -0 "$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)"; then
-            echo "no java process running cleaning up pid file"
-            rm -f /var/run/$jenkinsuser/jenkins_jnlp_pid;
-        else
-            echo "java connection process found and running already running quitting."
-            exit 1
+    if [[ $started_monit == "true" ]]; then
+        wget --timestamping https://build.opnfv.org/ci/jnlpJars/slave.jar && true
+        chown $jenkinsuser:$jenkinsuser slave.jar
+
+        if [[ -f /var/run/$jenkinsuser/jenkins_jnlp_pid ]]; then
+            echo "pid file found"
+            if ! kill -0 "$(/bin/cat /var/run/$jenkinsuser/jenkins_jnlp_pid)"; then
+                echo "no java process running cleaning up pid file"
+                rm -f /var/run/$jenkinsuser/jenkins_jnlp_pid;
+            else
+                echo "java connection process found and running already running quitting."
+                exit 1
+            fi
         fi
-    fi
 
-    if [[ $run_in_foreground == true ]]; then
-        $connectionstring
+        if [[ $run_in_foreground == true ]]; then
+            $connectionstring
+        else
+            exec $connectionstring &
+            echo $! > /var/run/$jenkinsuser/jenkins_jnlp_pid
+        fi
     else
-        exec $connectionstring &
-        echo $! > /var/run/$jenkinsuser/jenkins_jnlp_pid
+        echo "you are ready to start monit"
+        echo "eg: service monit start"
+        echo "example debug mode if you are having problems:  /usr/bin/monit -Ivv -c /etc/monit.conf "
+        exit 0
     fi
-else
-    echo "you are ready to start monit"
-    echo "eg: service monit start"
-    echo "example debug mode if you are having problems:  /usr/bin/monit -Ivv -c /etc/monit.conf "
-    exit 0
-fi
 }
 
 usage() {