Add more difference infrastructure; Check with Jira
This commit is contained in:
parent
0280c4ec00
commit
750955d8cd
1 changed files with 42 additions and 15 deletions
|
|
@ -169,6 +169,21 @@ def extractmerges(String line) {
|
|||
return [false, line]
|
||||
}
|
||||
|
||||
def jiraticketexists(String jiraticket) {
|
||||
def String URI = "${JIRA_URI}/browse/${jiraticket}"
|
||||
def get = new URL(URI).openConnection();
|
||||
get.setRequestProperty( 'X-AUSERNAME', "${JIRA_USERNAME}" )
|
||||
get.setRequestProperty( 'Authorization', "Basic ${JIRA_ENCODED_PASSWORD}" )
|
||||
get.setRequestProperty( 'User-Agent', 'groovy-2.4.4' )
|
||||
get.setRequestProperty( 'Accept', 'application/json' )
|
||||
def getRC = get.getResponseCode();
|
||||
|
||||
if(!getRC.equals(200)) {
|
||||
return [false, '']
|
||||
}
|
||||
return [true, URI]
|
||||
}
|
||||
|
||||
def extractjiraticketinfo(String line) {
|
||||
def List jiratickets = []
|
||||
|
||||
|
|
@ -178,22 +193,37 @@ def extractjiraticketinfo(String line) {
|
|||
def match1 = (line =~ pattern1)
|
||||
if (match1.find()) {
|
||||
jiraticket = match1.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match1.group(2)
|
||||
} else {
|
||||
def pattern2 = '^(\\w+\\d+)(.*)' //GIS1234 smb1234
|
||||
(exists, URI) = jiraticketexists(jiraticket)
|
||||
if (exists) {
|
||||
jiratickets.add([jiraticket, URI])
|
||||
line = match1.group(2)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
} else {
|
||||
def pattern2 = '^(\\w+)(\\d+)(.*)' //GIS1234 smb1234
|
||||
def match2 = (line =~ pattern2)
|
||||
if (match2.find()) {
|
||||
jiraticket = match2.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match2.group(2)
|
||||
jiraticket = match2.group(1) + "-" + match2.group(2)
|
||||
(exists, URI) = jiraticketexists(jiraticket)
|
||||
if (exists) {
|
||||
jiratickets.add([jiraticket, URI])
|
||||
line = match2.group(3)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
} else {
|
||||
def pattern3 = '^(\\w+ \\d+)(.*)' //GIS 1234 smb 1234
|
||||
def pattern3 = '^(\\w+)\\s(\\d+)(.*)' //GIS 1234 smb 1234
|
||||
def match3 = (line =~ pattern3)
|
||||
if (match3.find()) {
|
||||
jiraticket = match3.group(1)
|
||||
jiratickets.add(jiraticket)
|
||||
line = match3.group(2)
|
||||
jiraticket = match3.group(1) + "-" + match3.group(2)
|
||||
(exists, URI) = jiraticketexists(jiraticket)
|
||||
if (exists) {
|
||||
jiratickets.add([jiraticket, URI])
|
||||
line = match3.group(3)
|
||||
} else {
|
||||
break
|
||||
}
|
||||
} else {
|
||||
break
|
||||
}
|
||||
|
|
@ -352,14 +382,11 @@ def ticketedreport(String reportsubfolder, ticketed, boolean iscomponent = true)
|
|||
}
|
||||
|
||||
def unticketedreport(String reportsubfolder, unticketed, boolean iscomponent = true) {
|
||||
echo "Size of ticketed map: ${unticketed.size()}"
|
||||
dir(reportsubfolder) {
|
||||
String unticketedlist = "Unticketed list:\n"
|
||||
echo "unticketed map:\n${unticketed}"
|
||||
unticketedsorted = unticketed.sort()
|
||||
echo "unticketed map sorted:\n${unticketedsorted}"
|
||||
for (anunticketed in unticketedsorted) {
|
||||
unticketedlist += "${anunticketed.key}\n${anunticketed.value}"
|
||||
unticketedlist += "${anunticketed.key} (${anunticketed.value})\n"
|
||||
}
|
||||
writeFile(file: "unticketedlist.txt", text: unticketedlist)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue