blob: 12377b1c2408e1ad47436b195137e622d5b87fda [file] [log] [blame]
Sergey Kulanov56d0d052016-10-13 15:48:56 +03001getBinaryBuildProperties
2------------------------
3
41. getBinaryBuildProperties() should be used to define mandatory
5properties for binary artifact, which are:
6
7 "gerritProject=${env.GERRIT_PROJECT}",
8 "gerritChangeNumber=${env.GERRIT_CHANGE_NUMBER}",
9 "gerritPatchsetNumber=${env.GERRIT_PATCHSET_NUMBER}",
10 "gerritChangeId=${env.GERRIT_CHANGE_ID}",
11 "gitSha=${env.GERRIT_PATCHSET_REVISION}"
12
132. User can add some custom properties, e.g:
14
15def properties = tools.getBinaryBuildProperties(
16 ["test=123",
17 "prop1=val1",
18 prop2=val2"
19 ])
20
213. The resulting values will be the string in props format with
22namespace com.mirantis, e.g:
23
24 com.mirantis.gerritProject=asd;com.mirantis.gerritChangeNumber=123;com.mirantis.gerritChangeId=ddd
25
264. How to use:
27
28 def tools = new ci.mcp.Tools()
29 ...
30 def buildInfo = Artifactory.newBuildInfo()
31 ...
32 def properties = tools.getBinaryBuildProperties()
33 ...
34 // Create the upload spec.
35 def uploadSpec = """{
36 "files": [
37 {
38 "pattern": "**",
39 "target": "some/target",
40 "props": "${properties}"
41 }
42 ]
43 }"""
44 server.upload(uploadSpec, buildInfo)
45 server.publishBuildInfo buildInfo