| 
														
															@@ -1,11 +1,15 @@ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-// vars/gatherInfo.groovy 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-def call() { 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+def call(String branchOverride = null) { 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def duration = currentBuild.durationString.replace(' and counting', '') 
														 | 
														
														 | 
														
															     def duration = currentBuild.durationString.replace(' and counting', '') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def commitMsg  = sh(returnStdout: true, script: 'git log -1 --pretty=%B').trim() 
														 | 
														
														 | 
														
															     def commitMsg  = sh(returnStdout: true, script: 'git log -1 --pretty=%B').trim() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def author     = sh(returnStdout: true, script: 'git log -1 --pretty=%an').trim() 
														 | 
														
														 | 
														
															     def author     = sh(returnStdout: true, script: 'git log -1 --pretty=%an').trim() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     def commitTime = sh(returnStdout: true, script: 'git log -1 --pretty=%ci').trim() 
														 | 
														
														 | 
														
															     def commitTime = sh(returnStdout: true, script: 'git log -1 --pretty=%ci').trim() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    def branch     = env.BRANCH_NAME ?: env.GIT_BRANCH ?: 'unknown' 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    def buildUrl   = env.BUILD_URL.replace('http://68.79.46.88:8080', 'https://jenkins.adwebcloud.com') 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    // 优先级:外部传入 > GIT_BRANCH > BRANCH_NAME > unknown 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    def branch = branchOverride ?: env.GIT_BRANCH ?: env.BRANCH_NAME ?: 'unknown' 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    // 去掉多余空格 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    def buildUrl = env.BUILD_URL.replace('http://68.79.46.88:8080', 'https://jenkins.adwebcloud.com') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     return [ 
														 | 
														
														 | 
														
															     return [ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         duration : duration, 
														 | 
														
														 | 
														
															         duration : duration, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         commitMsg: commitMsg, 
														 | 
														
														 | 
														
															         commitMsg: commitMsg, 
														 |