-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
130 lines (120 loc) · 4.26 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
plugins {
id 'ru.iopump.qa.allure' version '0.1.1' // Apply plugin
}
// Use extension 'allureServer' to specify all settings.
allureServer {
/**
* 'allureArchive' task will try to find this directory in each module + root project.
* If you have multi-module project with 2 modules it will be:
* - root/module1/allure-results
* - root/module2/allure-results
* - root/allure-results
*/
relativeResultDir = 'allure-results'
/**
* 'allureArchive' You may override 'relativeResultDir' setting and specify each results directory as file collection
*
* OPTIONAL
* This settings or 'relativeResultDir' will be use. I recommend to use 'relativeResultDir'.
*/
// resultDirs = [ file("$buildDir/allure-result"), file("$rootDir/module1/allure-result-any") ]
/**
* tasks 'allureServerSend' and 'allureServerGenerate'
* Your allure-server base url.
*/
allureServerUrl = 'http://localhost:8080'
/**
* task 'allureServerGenerate'
* You may specify generation request body. Add build id, ci build url and others according to allure-server OpenApi Spec (Swagger).
* Now plugin has only one predefined request body for GitLab
* This parameter can be 'String' type with template name - now supported only 'GITLAB'
* Or enum GenerationBodyTemplate - now supported only 'GITLAB' enum
* Or Closure returned String like in this example
*
* OPTIONAL
* DEFAULT VALUE = 'GITLAB'
* If no GitLab environment variable found it will use default value as local build.
*/
requestToGeneration = { uuid -> """
{
"reportSpec": {
"path": [ "my_project" ],
"executorInfo": {
"name": "GitLab/Jenkins/Bamboo/GitHub CI",
"type": "GitLab/Jenkins/Bamboo/GitHub CI",
"buildName": "my_ci_build_name",
"buildUrl": "my_ci_build_url",
"reportName": "my_ci_report_name"
}
},
"results": [ "$uuid" ],
"deleteResults": true
}"""
}
/* ONLY FOR GITLAB (optional settings). For task 'allureGitLabCallback' */
/**
* Enable GitLab auto-callback after task 'allureServerGenerate' execution.
* It will post message in MergeRequest with Report URL.
* Now callback implemented only for GitLabCI.
*
* OPTIONAL
* DEFAULT VALUE = FALSE (disable)
*/
gitLabCallbackEnable = true // Optional
/**
* 'allureGitLabCallback'
* GitLab API TOKEN for callback.
*
* OPTIONAL
* DEFAULT VALUE = System.getenv('SERVICE_USER_API_TOKEN') (From GitLab CI environment)
*/
gitLabToken = "43rbdfui34bhx34rjn3c"
/**
* 'allureGitLabCallback'
* GitLab API url for callback.
*
* OPTIONAL
* DEFAULT VALUE = System.getenv('CI_API_V4_URL') (From GitLab CI environment)
*/
gitLabApiUrl = 'http://localhost:8081'
/**
* 'allureGitLabCallback'
* GitLab MergeRequest ID for callback.
*
* OPTIONAL
* DEFAULT VALUE = System.getenv('CI_MERGE_REQUEST_IID') (From GitLab CI environment)
*/
gitLabMergeRequestId = '0'
/**
* 'allureGitLabCallback'
* GitLab project ID for callback.
*
* OPTIONAL
* DEFAULT VALUE = System.getenv('CI_PROJECT_ID') (From GitLab CI environment)
*/
gitLabProjectId = '0'
}
/**
* GitLab API may be changed in future. And you have possibility to specify 'allureGitLabCallback' task.
* It's advance usage.
* I recommend to create issue in 'https://github.com/kochetkov-ma/allure-server-gradle' about GitLab API changes.
*/
allureGitLabCallback {
/**
* Override report url.
* Previous task store report url to 'build/generated-report-url.txt'
* You may get it, transform and set
*/
reportUrlString = 'test_override'
/**
* GitLab endpoint path to send URL in comments.
* You may change it.
* It must be a 'Closure<String>' object.
* This closure has delegate - Map<String, String> with keys 'apiUrl', 'projectId', 'mrId' - you may use it in GString as Lazy Placeholders like '{-> }'.
* !!! Remember only LAZY !!!
*/
gitLabMergeRequestNotesEndpointPath {
"${->apiUrl}/projects_override/${->projectId}/merge_requests/${->mrId}/notes"
}
}
wrapper { distributionType = Wrapper.DistributionType.ALL; gradleVersion = gradleWrapperVersion }