1+ #! groovy
2+ def call (config ) {
3+ config. pr. setBuildStatus(config, ' PENDING' , ' Toll gate (Gitler)' , ' Checking...' , ' ${BUILD_URL}flowGraphTable/' )
4+
5+ dir(config. repository_root) {
6+ step([$class : ' GitChangelogRecorder' , config : [configFile : ' git-changelog-settings.json' ,
7+ createFileTemplateContent : '''
8+ {{#commits}}
9+ {{{messageTitle}}}
10+ {{/commits}}
11+ ''' ,
12+ createFileTemplateFile : ' ' , createFileUseTemplateContent : true ,
13+ createFileUseTemplateFile : false , customIssues : [[link : ' ' , name : ' ' , pattern : ' ' , title : ' ' ],
14+ [link : ' ' , name : ' ' , pattern : ' ' , title : ' ' ]], dateFormat : ' YYYY-MM-dd HH:mm:ss' ,
15+ file : ' subjects.txt' , fromReference : env. CHANGE_TARGET , fromType : ' ref' , gitHubApi : ' ' ,
16+ gitHubApiTokenCredentialsId : ' ' , gitHubIssuePattern : ' #([0-9]+)' , gitHubToken : ' ' ,
17+ gitLabApiTokenCredentialsId : ' ' , gitLabProjectName : ' ' , gitLabServer : ' ' , gitLabToken : ' ' ,
18+ ignoreCommitsIfMessageMatches : ' ^Merge.*' ,
19+ ignoreCommitsWithoutIssue : false , ignoreTagsIfNameMatches : ' ' ,
20+ jiraIssuePattern : ' \\ b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\ b' , jiraPassword : ' ' , jiraServer : ' ' ,
21+ jiraUsername : ' ' , jiraUsernamePasswordCredentialsId : ' ' , mediaWikiPassword : ' ' ,
22+ mediaWikiTemplateContent : ' ' , mediaWikiTemplateFile : ' ' , mediaWikiTitle : ' ' , mediaWikiUrl : ' ' ,
23+ mediaWikiUseTemplateContent : false , mediaWikiUseTemplateFile : false , mediaWikiUsername : ' ' ,
24+ noIssueName : ' No issue' , readableTagName : ' /([^/]+?)$' , showSummary : false ,
25+ showSummaryTemplateContent : ' ' , showSummaryTemplateFile : ' ' , showSummaryUseTemplateContent : false ,
26+ showSummaryUseTemplateFile : false , subDirectory : ' ' , timeZone : ' UTC' ,
27+ toReference : config. git_sha, toType : ' commit' , untaggedName : ' Unreleased' ,
28+ useConfigFile : false , useFile : true , useGitHub : false , useGitHubApiTokenCredentials : false ,
29+ useGitLab : false , useGitLabApiTokenCredentials : false , useIgnoreTagsIfNameMatches : false ,
30+ useJira : false , useJiraUsernamePasswordCredentialsId : false , useMediaWiki : false ,
31+ useReadableTagName : false , useSubDirectory : false ]
32+ ])
33+ step([$class : ' GitChangelogRecorder' , config : [configFile : ' git-changelog-settings.json' ,
34+ createFileTemplateContent : '''
35+ {{#commits}}
36+ {{#messageBodyItems}}
37+ {{.}}
38+ {{/messageBodyItems}}
39+ {{/commits}}
40+ ''' ,
41+ createFileTemplateFile : ' ' , createFileUseTemplateContent : true ,
42+ createFileUseTemplateFile : false , customIssues : [[link : ' ' , name : ' ' , pattern : ' ' , title : ' ' ],
43+ [link : ' ' , name : ' ' , pattern : ' ' , title : ' ' ]], dateFormat : ' YYYY-MM-dd HH:mm:ss' ,
44+ file : ' bodies.txt' , fromReference : env. CHANGE_TARGET , fromType : ' ref' , gitHubApi : ' ' ,
45+ gitHubApiTokenCredentialsId : ' ' , gitHubIssuePattern : ' #([0-9]+)' , gitHubToken : ' ' ,
46+ gitLabApiTokenCredentialsId : ' ' , gitLabProjectName : ' ' , gitLabServer : ' ' , gitLabToken : ' ' ,
47+ ignoreCommitsIfMessageMatches : ' ^Merge.*' ,
48+ ignoreCommitsWithoutIssue : false , ignoreTagsIfNameMatches : ' ' ,
49+ jiraIssuePattern : ' \\ b[a-zA-Z]([a-zA-Z]+)-([0-9]+)\\ b' , jiraPassword : ' ' , jiraServer : ' ' ,
50+ jiraUsername : ' ' , jiraUsernamePasswordCredentialsId : ' ' , mediaWikiPassword : ' ' ,
51+ mediaWikiTemplateContent : ' ' , mediaWikiTemplateFile : ' ' , mediaWikiTitle : ' ' , mediaWikiUrl : ' ' ,
52+ mediaWikiUseTemplateContent : false , mediaWikiUseTemplateFile : false , mediaWikiUsername : ' ' ,
53+ noIssueName : ' No issue' , readableTagName : ' /([^/]+?)$' , showSummary : false ,
54+ showSummaryTemplateContent : ' ' , showSummaryTemplateFile : ' ' , showSummaryUseTemplateContent : false ,
55+ showSummaryUseTemplateFile : false , subDirectory : ' ' , timeZone : ' UTC' ,
56+ toReference : config. git_sha, toType : ' commit' , untaggedName : ' Unreleased' ,
57+ useConfigFile : false , useFile : true , useGitHub : false , useGitHubApiTokenCredentials : false ,
58+ useGitLab : false , useGitLabApiTokenCredentials : false , useIgnoreTagsIfNameMatches : false ,
59+ useJira : false , useJiraUsernamePasswordCredentialsId : false , useMediaWiki : false ,
60+ useReadableTagName : false , useSubDirectory : false ]
61+ ])
62+ }
63+
64+ ret = sh(returnStatus : true ,
65+ script :""" #!/bin/bash
66+ cd ${ config.repository_root} /.ci
67+ ./gitler.sh""" )
68+
69+ publishHTML([allowMissing : true , alwaysLinkToLastBuild : false , keepAll : true ,
70+ reportDir : config. repository_root,
71+ reportFiles : ' gitler.html' , reportName : ' Gitler report' , reportTitles : ' ' ])
72+ if (ret == 1 ) {
73+ config. pr. setBuildStatus(config, ' FAILURE' , ' Toll gate (Gitler)' , ' Commit(s) does not meet coding standards' , ' ${BUILD_URL}Gitler_report/gitler.html' )
74+ currentBuild. currentResult == ' FAILURE'
75+ echo " Termiated due to Gitler assert" // For BFA
76+ error ' Termiated due to Gitler assert'
77+ } else {
78+ config. pr. setBuildStatus(config, ' SUCCESS' , ' Toll gate (Gitler)' , ' Pass' , ' ' )
79+ }
80+ }
81+
82+ return this
0 commit comments