Skip to content

Commit f7de3df

Browse files
Merge branch 'main' into PORT-16638-Fix-Default-Mapping-For-GitHub-Ocean
2 parents 22d0af8 + 499212a commit f7de3df

12 files changed

+445
-467
lines changed

docs/build-your-software-catalog/sync-data-to-catalog/argocd/example.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To view and test the integration's mapping against examples of the third-party A
88
## Cluster
99

1010
<details>
11-
<summary>Cluster blueprint</summary>
11+
<summary><b>Cluster blueprint (click to expand)</b></summary>
1212

1313
```json showLineNumbers
1414
{
@@ -60,7 +60,7 @@ To view and test the integration's mapping against examples of the third-party A
6060
</details>
6161

6262
<details>
63-
<summary>Integration configuration</summary>
63+
<summary><b>Integration configuration (click to expand)</b></summary>
6464

6565
```yaml showLineNumbers
6666
createMissingRelatedEntities: true
@@ -88,7 +88,7 @@ resources:
8888
## Namespace
8989
9090
<details>
91-
<summary>Namespace blueprint</summary>
91+
<summary><b>Namespace blueprint (click to expand)</b></summary>
9292
9393
```json showLineNumbers
9494
{
@@ -117,7 +117,7 @@ resources:
117117
</details>
118118

119119
<details>
120-
<summary>Integration configuration</summary>
120+
<summary><b>Integration configuration (click to expand)</b></summary>
121121

122122
```yaml showLineNumbers
123123
createMissingRelatedEntities: true
@@ -143,9 +143,9 @@ resources:
143143
## Project
144144
145145
<details>
146-
<summary> Project blueprint</summary>
146+
<summary><b>Project blueprint (click to expand)</b></summary>
147147
148-
```json showlineNumbers
148+
```json showLineNumbers
149149
{
150150
"identifier": "argocdProject",
151151
"description": "This blueprint represents an ArgoCD Project",
@@ -177,7 +177,7 @@ resources:
177177
</details>
178178

179179
<details>
180-
<summary>Integration configuration</summary>
180+
<summary><b>Integration configuration (click to expand)</b></summary>
181181

182182
```yaml showLineNumbers
183183
createMissingRelatedEntities: true
@@ -202,7 +202,7 @@ resources:
202202
## Application
203203
204204
<details>
205-
<summary> Application blueprint</summary>
205+
<summary><b>Application blueprint (click to expand)</b></summary>
206206
207207
```json showlineNumbers
208208
{
@@ -321,7 +321,7 @@ resources:
321321
</details>
322322

323323
<details>
324-
<summary>Integration configuration</summary>
324+
<summary><b>Integration configuration (click to expand)</b></summary>
325325

326326
```yaml showLineNumbers
327327
createMissingRelatedEntities: true
@@ -358,7 +358,7 @@ resources:
358358
## Deployment history
359359
360360
<details>
361-
<summary> Deployment history blueprint</summary>
361+
<summary><b>Deployment history blueprint (click to expand)</b></summary>
362362
363363
```json showlineNumbers
364364
{
@@ -414,7 +414,7 @@ resources:
414414
</details>
415415

416416
<details>
417-
<summary>Integration configuration</summary>
417+
<summary><b>Integration configuration (click to expand)</b></summary>
418418

419419
```yaml showLineNumbers
420420
createMissingRelatedEntities: true
@@ -446,7 +446,7 @@ resources:
446446
## Kubernetes Resource
447447
448448
<details>
449-
<summary> Images blueprint</summary>
449+
<summary><b>Images blueprint (click to expand)</b></summary>
450450
451451
```json showlineNumbers
452452
{
@@ -468,7 +468,7 @@ resources:
468468
</details>
469469

470470
<details>
471-
<summary> Kubernetes resource blueprint</summary>
471+
<summary><b>Kubernetes resource blueprint (click to expand)</b></summary>
472472

473473
```json showlineNumbers
474474
{
@@ -534,7 +534,7 @@ resources:
534534

535535

536536
<details>
537-
<summary>Integration configuration</summary>
537+
<summary><b>Integration configuration (click to expand)</b></summary>
538538

539539
```yaml showLineNumbers
540540
createMissingRelatedEntities: true
@@ -552,11 +552,13 @@ resources:
552552
properties:
553553
kind: .kind
554554
namespace: .namespace
555-
version: .resourceVersion
556-
annotations: .liveState | fromjson | .metadata.annotations
557-
labels: .liveState | fromjson | .metadata.labels
555+
version: if .kind == "Deployment" then .resourceVersion else null end
556+
annotations: (.liveState // .targetState) | fromjson | .metadata.annotations
557+
labels: (.liveState // .targetState) | fromjson | .metadata.labels
558558
relations:
559559
application: .__application.metadata.uid
560-
image: 'if .kind == "Deployment" then .liveState | fromjson | .spec.template.spec.containers[0].image else null end'
560+
image: >-
561+
if .kind == "Deployment" then (.liveState // .targetState) |
562+
fromjson | .spec.template.spec.containers[0].image else null end
561563
```
562564
</details>

docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_blueprint.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<details>
2+
<summary><b>Build blueprint (click to expand)</b></summary>
13
```json showLineNumbers
24
{
35
"identifier": "jenkinsBuild",
@@ -47,3 +49,4 @@
4749
}
4850
}
4951
```
52+
</details>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import Tabs from "@theme/Tabs"
2+
import TabItem from "@theme/TabItem"
3+
4+
<details>
5+
<summary><b>Integration configuration (click to expand)</b></summary>
6+
```yaml showLineNumbers
7+
createMissingRelatedEntities: true
8+
deleteDependentEntities: true
9+
resources:
10+
- kind: build
11+
selector:
12+
query: "true"
13+
maxBuildsPerJob: 100
14+
port:
15+
entity:
16+
mappings:
17+
identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1]
18+
title: .displayName
19+
blueprint: '"jenkinsBuild"'
20+
properties:
21+
buildStatus: .result
22+
buildUrl: .url
23+
buildDuration: .duration
24+
timestamp: '.timestamp / 1000 | todate'
25+
relations:
26+
parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "")
27+
previousBuild: >-
28+
if .previousBuild then (.previousBuild.url | split("://")[1] |
29+
sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") |
30+
gsub("/"; "-") | .[:-1]) else null end
31+
```
32+
</details>
33+
34+
<Tabs groupId="config" queryString="parameter">
35+
36+
<TabItem label="Include Max Builds Per Job" value="includeMaxBuildsPerJob">
37+
38+
The `maxBuildsPerJob` selector is an optional parameter that allows you to limit the number of builds to fetch for each job.
39+
By default, this selector is set to `100` which means the last 100 builds of each job will be fetched.
40+
41+
```yaml
42+
- kind: build
43+
selector:
44+
query: 'true'
45+
# highlight-next-line
46+
maxBuildsPerJob: 100
47+
```
48+
49+
</TabItem>
50+
51+
</Tabs>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<details>
2+
<summary><b>Default mapping configuration (click to expand)</b></summary>
3+
4+
```yaml showLineNumbers
5+
createMissingRelatedEntities: true
6+
deleteDependentEntities: true
7+
resources:
8+
- kind: job
9+
selector:
10+
query: 'true'
11+
port:
12+
entity:
13+
mappings:
14+
identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1]
15+
title: .fullName
16+
blueprint: '"jenkinsJob"'
17+
properties:
18+
jobName: .name
19+
url: .url
20+
jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]'
21+
timestamp: .time
22+
parentJob: .__parentJob
23+
24+
25+
- kind: build
26+
selector:
27+
query: 'true'
28+
maxBuildsPerJob: 100
29+
port:
30+
entity:
31+
mappings:
32+
identifier: >-
33+
.url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1]
34+
title: .displayName
35+
blueprint: '"jenkinsBuild"'
36+
properties:
37+
buildStatus: .result
38+
buildUrl: .url
39+
buildDuration: .duration
40+
timestamp: .timestamp / 1000 | todate
41+
relations:
42+
parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "")
43+
previousBuild: >-
44+
if .previousBuild then (.previousBuild.url | split("://")[1] |
45+
sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") |
46+
gsub("/"; "-") | .[:-1]) else null end
47+
48+
- kind: user
49+
selector:
50+
query: 'true'
51+
port:
52+
entity:
53+
mappings:
54+
identifier: .user.id
55+
title: .user.fullName
56+
blueprint: '"jenkinsUser"'
57+
properties:
58+
url: .user.absoluteUrl
59+
lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ")
60+
```
61+
</details>

docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_blueprint.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<details>
2+
<summary><b>Job blueprint (click to expand)</b></summary>
13
```json showLineNumbers
24
{
35
"identifier": "jenkinsJob",
@@ -45,3 +47,4 @@
4547
"relations": {}
4648
}
4749
```
50+
</details>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<details>
2+
<summary><b>Integration configuration (click to expand)</b></summary>
3+
```yaml showLineNumbers
4+
createMissingRelatedEntities: true
5+
deleteDependentEntities: true
6+
resources:
7+
- kind: job
8+
selector:
9+
query: "true"
10+
port:
11+
entity:
12+
mappings:
13+
identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1]
14+
title: .fullName
15+
blueprint: '"jenkinsJob"'
16+
properties:
17+
jobName: .name
18+
url: .url
19+
jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]'
20+
timestamp: .time
21+
parentJob: .__parentJob
22+
```
23+
</details>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<details>
2+
<summary><b>Stage blueprint (click to expand)</b></summary>
3+
4+
```json showLineNumbers
5+
{
6+
"identifier": "jenkinsStage",
7+
"description": "This blueprint represents a stage in a Jenkins build",
8+
"title": "Jenkins Stage",
9+
"icon": "Jenkins",
10+
"schema": {
11+
"properties": {
12+
"status": {
13+
"type": "string",
14+
"title": "Stage Status",
15+
"enum": [
16+
"SUCCESS",
17+
"FAILURE",
18+
"UNSTABLE",
19+
"ABORTED",
20+
"IN_PROGRESS",
21+
"NOT_BUILT",
22+
"PAUSED_PENDING_INPUT"
23+
],
24+
"enumColors": {
25+
"SUCCESS": "green",
26+
"FAILURE": "red",
27+
"UNSTABLE": "yellow",
28+
"ABORTED": "darkGray",
29+
"IN_PROGRESS": "blue",
30+
"NOT_BUILT": "lightGray",
31+
"PAUSED_PENDING_INPUT": "orange"
32+
}
33+
},
34+
"startTimeMillis": {
35+
"type": "number",
36+
"title": "Start Time (ms)",
37+
"description": "Timestamp in milliseconds when the stage started"
38+
},
39+
"durationMillis": {
40+
"type": "number",
41+
"title": "Duration (ms)",
42+
"description": "Duration of the stage in milliseconds"
43+
},
44+
"stageUrl": {
45+
"type": "string",
46+
"title": "Stage URL",
47+
"description": "URL to the stage"
48+
}
49+
},
50+
"required": []
51+
},
52+
"mirrorProperties": {},
53+
"calculationProperties": {},
54+
"relations": {
55+
"parentBuild": {
56+
"title": "Jenkins Build",
57+
"target": "jenkinsBuild",
58+
"required": true,
59+
"many": false
60+
}
61+
}
62+
}
63+
```
64+
65+
</details>

0 commit comments

Comments
 (0)