Fix onos-app-release.groovy
This script was failing as published, but thanks to config history,
we were able to recover the version that worked for the last release,
which was never committed.
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
Change-Id: I40531b16556bee811c2c021db03801c590ee8ccc
diff --git a/jjb/pipeline/onos-app-release.groovy b/jjb/pipeline/onos-app-release.groovy
index cc98783..9132e66 100644
--- a/jjb/pipeline/onos-app-release.groovy
+++ b/jjb/pipeline/onos-app-release.groovy
@@ -73,9 +73,11 @@
println('''
** -----------------------------------------------------------------------
-** git config --list
+** DEBUG: git config --list
** -----------------------------------------------------------------------
''')
+
+ sh '''echo "RUNNING: git config --list" '''
sh 'git config --list'
println('''
@@ -86,9 +88,6 @@
''')
sh 'git config --global --list'
- println('\nWANTED: git config --bool --get gerrit.createChangeId')
- sh '''git config --bool --get gerrit.createChangedId' && echo "gerrit.createChangedId=[$?]'''
-
leave(name)
return
@@ -131,6 +130,10 @@
}
stage ('Configure system') {
+
+ String attempt = "1"
+ enter('Configure system: ' + attempt)
+
echo "Job triggered by " + userId
// FIXME: supply Jenkins-owned known_hosts file via config_file_provider
// https://jenkins.io/doc/pipeline/steps/config-file-provider/
@@ -143,6 +146,7 @@
withCredentials([file(credentialsId: 'gpg-creds-maven', variable: 'GPUPG')]) {
sh 'tar -xvf $GPUPG -C ~'
}
+ leave('Configure system: ' + attempt)
}
stage ('Check out code') {
@@ -167,9 +171,12 @@
changeApiVersion(appName, apiVersion)
}
- git_debug("Move to release version")
+ git_debug("Move to release version")
- sh 'git add -A && git commit -m "Release app version ' + version + ' with API version ' + apiVersion + '"'
+ // Explicitly set hooksPath. Need to figure out logic to detect and
+ // test if unset -- else multiple cases where Exception is thrown.
+ sh """git config --local core.hooksPath './.git/hooks'""" // limited scope
+ sh 'git add -A && git commit -sm "Release app version ' + version + ' with API version ' + apiVersion + '"'
}
stage ('Verify code') {
@@ -204,8 +211,7 @@
}
git_debug("Move to next SNAPSHOT version")
-
- sh 'git add -A && git commit -m "Starting snapshot ' + snapshot + ' with API version ' + apiSnapshot + '"'
+ sh 'git add -A && git commit -sm "Starting snapshot ' + snapshot + ' with API version ' + apiSnapshot + '"'
println("\nSnapshot commit message: branch=HEAD")
sh """git log -1 --pretty=format:'%b' HEAD"""
@@ -222,7 +228,12 @@
sh 'echo "Release done!"'
sh 'echo "Go to Gerrit and merge new changes"'
sh 'echo "Go to http://oss.sonatype.org and release the artifacts (after the maven-publish job completes)"'
- }
+
+ // Restore config: secure but what changed (?)
+ // Should revert completely to 'factory defaults'
+ println("Revert core.hooksPath")
+ sh """git config --local core.hooksPath '/dev/null'""" // limited scope
+ }
}
// [EOF]