moving support branch creation to beginning
Change-Id: I94446dd31e6021bd3c1190ecaf7f65bb61d3ce3a
diff --git a/Jenkinsfile b/Jenkinsfile
index 20a22b6..ca2fa77 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -24,9 +24,9 @@
sh returnStdout: true, script: cmd
}
-def checkBranchExists(def proj) {
+int checkBranchExists(def proj) {
if (env.IGNORE_LIST.contains(proj)) {
- return
+ return 0
}
url = 'https://gerrit.opencord.org/projects/' + proj + '/branches/' + env.BRANCH_NAME
response = httpRequest url: url, validResponseCodes: '200,404'
@@ -43,9 +43,9 @@
def url = 'https://gerrit.opencord.org/projects/?type=CODE'
def response = httpRequest url: url, validResponseCodes: '200'
def info = jsonParseList(response.content)
- def created = 0
+ int created = 0
for (index = 0; index < info.size(); index++) {
- created = created + checkBranchExists(info[index])
+ created += checkBranchExists(info[index])
}
if (created == 0) {