How do I use Jenkins and RTC to do Maven releases?
Caveat: I'm a git and Jenkins master, but only an apprentice at RTC and journeyman at Maven.
So I have a Jenkins server, a Jazz SCM server and a Nexus server (maven repository). Jenkins has the Team Concert plugin installed.
I have jobs that successfully build snapshots.
However, when I try to do a release via "Perform Maven Release" in Jenkins, it dies a horrible death.
Firstly, I have to install scmtools. :-( This is because the maven jazz scm provider doesn't support buildtools.
And even when I do, and have my settings.xml set up correctly with a <server> section with my RTC credentials I get an error 54. I was able to reproduce the problem via command line to get extra information:
bash$ scm status --username jenkins-ci --password "$(cat ~/.p)" ; echo exitcode $? Workspace: (1000) "CGH Test Workspace" (This workspace is unreachable.)I was able to work around this by manually running "scm login" on all the build slaves as the build user, but that is not a good way to do things. :-(
Could not determine the URI required to connect to the repository. The UUID of
the repository is _gMhn4XGQRd6WdpIzJ8zv-g. If you know the repository URI run
'login' command providing the repository URI. If not, please contact your
administrator.
exitcode 54
I'm running RTC (and scmtools) version 4.0.1, if that matters.
Accepted answer
Try to cache credentials via scm login -c (-c option). This will create repository.txt file under $HOME/.jazz-scm. This file is cached until "scm logout". Copy the directory somewhere, and specify the location via environmental varable CM_CONFIG_DIRECTORY or via option --config.
Some details can be found in this forum discussion.
https://jazz.net/forum/questions/115922/rtc-command-line-interface-password-encryption
Some details can be found in this forum discussion.
https://jazz.net/forum/questions/115922/rtc-command-line-interface-password-encryption
One other answer
The problem is that the workspace is loaded by the Team Concert plugin in Jenkins, which doesn't cache repository login info in the same way as the SCM CLI.
This is a known issue, covered by: SCM CLI does not know repository URL for loaded workspace if it wasn't loaded by CLI (242038)
Doing a manual scm login is one workaround, but I agree it's tedious. Another approach would be to do it from the maven script before doing the release.