@@ -163,6 +163,64 @@ resources:
163163 value : ' [.reviewers[].uniqueName]'
164164 azure_devops_reviewers : ' [.reviewers[].id]'
165165 azure_devops_creator : .createdBy.id
166+ - kind : build
167+ selector :
168+ query : " true"
169+ port :
170+ entity :
171+ mappings :
172+ identifier : .__project.id + "-" + (.id | tostring) | gsub(" "; "")
173+ title : .buildNumber
174+ blueprint : ' "build"'
175+ properties :
176+ status : .status
177+ result : .result
178+ queueTime : .queueTime
179+ startTime : .startTime
180+ finishTime : .finishTime
181+ definitionName : .definition.name
182+ requestedFor : .requestedFor.displayName
183+ link : ._links.web.href
184+ relations :
185+ project : .__project.id | gsub(" "; "")
186+ - kind : pipeline-stage
187+ selector :
188+ query : ' true'
189+ port :
190+ entity :
191+ mappings :
192+ identifier : >-
193+ .__project.id + "-" + (.__buildId | tostring) + "-" + (.id |
194+ tostring) | gsub(" "; "")
195+ title : .name
196+ blueprint : ' "pipeline-stage"'
197+ properties :
198+ state : .state
199+ result : .result
200+ startTime : .startTime
201+ finishTime : .finishTime
202+ stageType : .type
203+ relations :
204+ project : .__project.id | gsub(" "; "")
205+ build : (.__project.id + "-" + (.__buildId | tostring)) | gsub(" "; "")
206+ - kind : pipeline-run
207+ selector :
208+ query : ' true'
209+ port :
210+ entity :
211+ mappings :
212+ identifier : >-
213+ .__project.id + "-" + (.__pipeline.id | tostring) + "-" + (.id |
214+ tostring) | gsub(" "; "")
215+ blueprint : ' "pipeline-run"'
216+ properties :
217+ state : .state
218+ result : .result
219+ createdDate : .createdDate
220+ finishedDate : .finishedDate
221+ pipelineName : .pipeline.name
222+ relations :
223+ project : .__project.id | gsub(" "; "")
166224` ` `
167225
168226</details>
@@ -858,6 +916,96 @@ Here is an example of the payload structure from Azure DevOps:
858916
859917
860918
919+ <details>
920+ <summary> Build response data</summary>
921+
922+ ` ` ` json showLineNumbers
923+ {
924+ "_links": {
925+ "self": {
926+ "href": "[REDACTED]/fd029361-7854-4cdd-8ace-bb033fca399c/_apis/build/builds/123"
927+ },
928+ "web": {
929+ "href": "[REDACTED]/fd029361-7854-4cdd-8ace-bb033fca399c/_build/results?buildId=123"
930+ }
931+ },
932+ "id": 123,
933+ "buildNumber": "20231114.1",
934+ "status": "completed",
935+ "result": "succeeded",
936+ "queueTime": "2023-11-14T07:00:00.000Z",
937+ "startTime": "2023-11-14T07:00:15.000Z",
938+ "finishTime": "2023-11-14T07:05:30.000Z",
939+ "definition": {
940+ "id": 7,
941+ "name": "health-catalist",
942+ "path": "\\ "
943+ },
944+ "requestedFor": {
945+ "displayName": "Jaden Kodjo Miles",
946+ "id": "40bee502-30c1-6eb5-9750-f9d35fa66e6f",
947+ "uniqueName": "doe@gmail.com"
948+ },
949+ "__project": {
950+ "id": "fd029361-7854-4cdd-8ace-bb033fca399c",
951+ "name": "Port Integration"
952+ }
953+ }
954+ ` ` `
955+
956+ </details>
957+
958+ <details>
959+ <summary> Pipeline-stage response data</summary>
960+
961+ ` ` ` json showLineNumbers
962+ {
963+ "id": 1,
964+ "name": "Build",
965+ "type": "build",
966+ "state": "completed",
967+ "result": "succeeded",
968+ "startTime": "2023-11-14T07:00:15.000Z",
969+ "finishTime": "2023-11-14T07:02:45.000Z",
970+ "__project": {
971+ "id": "fd029361-7854-4cdd-8ace-bb033fca399c",
972+ "name": "Port Integration"
973+ },
974+ "__buildId": 123
975+ }
976+ ` ` `
977+
978+ </details>
979+
980+ <details>
981+ <summary> Pipeline-run response data</summary>
982+
983+ ` ` ` json showLineNumbers
984+ {
985+ "id": 456,
986+ "state": "completed",
987+ "result": "succeeded",
988+ "createdDate": "2023-11-14T07:00:00.000Z",
989+ "finishedDate": "2023-11-14T07:05:30.000Z",
990+ "pipeline": {
991+ "id": 7,
992+ "name": "health-catalist"
993+ },
994+ "__project": {
995+ "id": "fd029361-7854-4cdd-8ace-bb033fca399c",
996+ "name": "Port Integration"
997+ },
998+ "__pipeline": {
999+ "id": 7
1000+ }
1001+ }
1002+ ` ` `
1003+
1004+ </details>
1005+
1006+
1007+
1008+
8611009# ## Mapping Result
8621010
8631011The combination of the sample payload and the Ocean configuration generates the following Port entity :
@@ -978,6 +1126,81 @@ The combination of the sample payload and the Ocean configuration generates the
9781126
9791127
9801128
1129+ <details>
1130+ <summary> Build entity in Port </summary>
1131+
1132+ ` ` ` json showLineNumbers
1133+ {
1134+ "identifier": "fd029361-7854-4cdd-8ace-bb033fca399c-123",
1135+ "title": "20231114.1",
1136+ "blueprint": "build",
1137+ "properties": {
1138+ "status": "completed",
1139+ "result": "succeeded",
1140+ "queueTime": "2023-11-14T07:00:00.000Z",
1141+ "startTime": "2023-11-14T07:00:15.000Z",
1142+ "finishTime": "2023-11-14T07:05:30.000Z",
1143+ "definitionName": "health-catalist",
1144+ "requestedFor": "Jaden Kodjo Miles",
1145+ "link": "[REDACTED]/fd029361-7854-4cdd-8ace-bb033fca399c/_build/results?buildId=123"
1146+ },
1147+ "relations": {
1148+ "project": "fd029361-7854-4cdd-8ace-bb033fca399c"
1149+ }
1150+ }
1151+ ` ` `
1152+
1153+ </details>
1154+
1155+ <details>
1156+ <summary> Pipeline-stage entity in Port </summary>
1157+
1158+ ` ` ` json showLineNumbers
1159+ {
1160+ "identifier": "fd029361-7854-4cdd-8ace-bb033fca399c-123-1",
1161+ "title": "Build",
1162+ "blueprint": "pipeline-stage",
1163+ "properties": {
1164+ "state": "completed",
1165+ "result": "succeeded",
1166+ "startTime": "2023-11-14T07:00:15.000Z",
1167+ "finishTime": "2023-11-14T07:02:45.000Z",
1168+ "stageType": "build"
1169+ },
1170+ "relations": {
1171+ "project": "fd029361-7854-4cdd-8ace-bb033fca399c",
1172+ "build": "fd029361-7854-4cdd-8ace-bb033fca399c-123"
1173+ }
1174+ }
1175+ ` ` `
1176+
1177+ </details>
1178+
1179+ <details>
1180+ <summary> Pipeline-run entity in Port </summary>
1181+
1182+ ` ` ` json showLineNumbers
1183+ {
1184+ "identifier": "fd029361-7854-4cdd-8ace-bb033fca399c-7-456",
1185+ "blueprint": "pipeline-run",
1186+ "properties": {
1187+ "state": "completed",
1188+ "result": "succeeded",
1189+ "createdDate": "2023-11-14T07:00:00.000Z",
1190+ "finishedDate": "2023-11-14T07:05:30.000Z",
1191+ "pipelineName": "health-catalist"
1192+ },
1193+ "relations": {
1194+ "project": "fd029361-7854-4cdd-8ace-bb033fca399c"
1195+ }
1196+ }
1197+ ` ` `
1198+
1199+ </details>
1200+
1201+
1202+
1203+
9811204# # Relevant Guides
9821205For relevant guides and examples, see the [guides section](https://docs.port.io/guides?tags=AzureDevops).
9831206
0 commit comments