fork download
  1. def lastCommitMessage = '''
  2. Merge pull request #746 in GMDP/gmdp from release/1.0 to master
  3.  
  4. * commit 'a076100159ad499b9dadce8ed8b4d20d0731d441':
  5. GMDP-5173. updating nexus host
  6. '''
  7.  
  8. def fromBranch = (lastCommitMessage =~ "Merge pull request #\\d+ in \\w*\\/\\w* from (\\S*) to ")[0][1]
  9. def (fromBranchType, commitVersion) = fromBranch.split('/')
  10.  
  11. if (fromBranchType == 'release') {
  12. commitVersion = '${commitVersion}.0'
  13. }
  14.  
  15. println fromBranchType
  16. println commitVersion
  17.  
  18. def releasePieces = commitVersion.split('.')
  19. println releasePieces
Success #stdin #stdout 0.84s 4456448KB
stdin
Standard input is empty
stdout
release
${commitVersion}.0
[]