| getBinaryBuildProperties |
| ------------------------ |
| |
| 1. getBinaryBuildProperties() should be used to define mandatory |
| properties for binary artifact, which are: |
| |
| "gerritProject=${env.GERRIT_PROJECT}", |
| "gerritChangeNumber=${env.GERRIT_CHANGE_NUMBER}", |
| "gerritPatchsetNumber=${env.GERRIT_PATCHSET_NUMBER}", |
| "gerritChangeId=${env.GERRIT_CHANGE_ID}", |
| "gitSha=${env.GERRIT_PATCHSET_REVISION}" |
| |
| 2. User can add some custom properties, e.g: |
| |
| def properties = tools.getBinaryBuildProperties( |
| ["test=123", |
| "prop1=val1", |
| prop2=val2" |
| ]) |
| |
| 3. The resulting values will be the string in props format with |
| namespace com.mirantis, e.g: |
| |
| com.mirantis.gerritProject=asd;com.mirantis.gerritChangeNumber=123;com.mirantis.gerritChangeId=ddd |
| |
| 4. How to use: |
| |
| def tools = new ci.mcp.Tools() |
| ... |
| def buildInfo = Artifactory.newBuildInfo() |
| ... |
| def properties = tools.getBinaryBuildProperties() |
| ... |
| // Create the upload spec. |
| def uploadSpec = """{ |
| "files": [ |
| { |
| "pattern": "**", |
| "target": "some/target", |
| "props": "${properties}" |
| } |
| ] |
| }""" |
| server.upload(uploadSpec, buildInfo) |
| server.publishBuildInfo buildInfo |