Fix for empty apiVersion check

Change-Id: I07865c3ad77095184a24a1a007e51814b52ed80b
diff --git a/jjb/onos-app-release.yaml b/jjb/onos-app-release.yaml
index e168556..99c9a1d 100644
--- a/jjb/onos-app-release.yaml
+++ b/jjb/onos-app-release.yaml
@@ -32,7 +32,7 @@
       - string:
           name: appRepo
           default: ''
-          description: 'Name of the app repository on the OpenCORD Gerrit server.\n e.g. vtn'
+          description: 'Name of the app repository on the OpenCORD Gerrit server.\n e.g. olt'
 
       - string:
           name: appName
@@ -47,7 +47,7 @@
       - string:
           name: nextApiVersion
           default: ''
-          description: 'Version to release.\n e.g. 1.0.0'
+          description: 'Snapshot version to move the code forward to.\n e.g. 1.1.0'
 
       - string:
           name: version
diff --git a/jjb/pipeline/onos-app-release.groovy b/jjb/pipeline/onos-app-release.groovy
index f8d87de..dc022e1 100644
--- a/jjb/pipeline/onos-app-release.groovy
+++ b/jjb/pipeline/onos-app-release.groovy
@@ -83,10 +83,14 @@
   }
 
   stage ('Move to release version') {
+    sh 'echo app version ' + version
+    sh 'echo api version ' + apiVersion
+
     //Splitting version and apiVersion and check if apiVersion different from empty then update API it.
     //Allows to release apps that dont' have api.version (e.g. bng,pppoe,kafka)
     changeVersion(version)
-    if (apiVersion != "") {
+    if (!params.apiVersion.isEmpty()) {
+       sh 'echo releasing api version' + '"' + apiVersion +'"'
        changeApiVersion(appName, apiVersion)
     }
     sh 'git add -A && git commit -m "Release app version ' + version + ' with API version ' + apiVersion + '"'
@@ -113,8 +117,13 @@
   stage ('Move to next SNAPSHOT version') {
     def snapshot = nextVersion + '-SNAPSHOT'
     def apiSnapshot = nextApiVersion + '-SNAPSHOT'
+
+    sh 'echo next app version ' + nextVersion
+    sh 'echo next api version ' + nextApiVersion
+
     changeVersion(snapshot)
-    if (apiVersion != "") {
+    if (!params.nextApiVersion.isEmpty()) {
+       sh 'echo moving to next api version' + '"' + nextApiVersion +'"'
        changeApiVersion(appName, apiSnapshot)
     }
     sh 'git add -A && git commit -m "Starting snapshot ' + snapshot + ' with API version ' + apiSnapshot + '"'