diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_blueprint.mdx index 37f06787b1..a07df1025d 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_blueprint.mdx +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_blueprint.mdx @@ -1,3 +1,5 @@ +
+Build blueprint (click to expand) ```json showLineNumbers { "identifier": "jenkinsBuild", @@ -47,3 +49,4 @@ } } ``` +
diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx new file mode 100644 index 0000000000..78176df411 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_build_configuration.mdx @@ -0,0 +1,51 @@ +import Tabs from "@theme/Tabs" +import TabItem from "@theme/TabItem" + +
+Integration configuration (click to expand) +```yaml showLineNumbers + createMissingRelatedEntities: true + deleteDependentEntities: true + resources: + - kind: build + selector: + query: "true" + maxBuildsPerJob: 100 + port: + entity: + mappings: + identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] + title: .displayName + blueprint: '"jenkinsBuild"' + properties: + buildStatus: .result + buildUrl: .url + buildDuration: .duration + timestamp: '.timestamp / 1000 | todate' + relations: + parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") + previousBuild: >- + if .previousBuild then (.previousBuild.url | split("://")[1] | + sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | + gsub("/"; "-") | .[:-1]) else null end +``` +
+ + + + + +The `maxBuildsPerJob` selector is an optional parameter that allows you to limit the number of builds to fetch for each job. +By default, this selector is set to `100` which means the last 100 builds of each job will be fetched. + +```yaml + - kind: build + selector: + query: 'true' + # highlight-next-line + maxBuildsPerJob: 100 +``` + + + + \ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_default_mapping_configuration.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_default_mapping_configuration.mdx new file mode 100644 index 0000000000..11a20e6f9b --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_default_mapping_configuration.mdx @@ -0,0 +1,61 @@ +
+Default mapping configuration (click to expand) + +```yaml showLineNumbers +createMissingRelatedEntities: true +deleteDependentEntities: true +resources: + - kind: job + selector: + query: 'true' + port: + entity: + mappings: + identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] + title: .fullName + blueprint: '"jenkinsJob"' + properties: + jobName: .name + url: .url + jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' + timestamp: .time + parentJob: .__parentJob + + + - kind: build + selector: + query: 'true' + maxBuildsPerJob: 100 + port: + entity: + mappings: + identifier: >- + .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] + title: .displayName + blueprint: '"jenkinsBuild"' + properties: + buildStatus: .result + buildUrl: .url + buildDuration: .duration + timestamp: .timestamp / 1000 | todate + relations: + parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") + previousBuild: >- + if .previousBuild then (.previousBuild.url | split("://")[1] | + sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | + gsub("/"; "-") | .[:-1]) else null end + + - kind: user + selector: + query: 'true' + port: + entity: + mappings: + identifier: .user.id + title: .user.fullName + blueprint: '"jenkinsUser"' + properties: + url: .user.absoluteUrl + lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") +``` +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_blueprint.mdx index c03c1d95ee..d1c7164f46 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_blueprint.mdx +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_blueprint.mdx @@ -1,3 +1,5 @@ +
+Job blueprint (click to expand) ```json showLineNumbers { "identifier": "jenkinsJob", @@ -45,3 +47,4 @@ "relations": {} } ``` +
diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_configuration.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_configuration.mdx new file mode 100644 index 0000000000..7bb1dcdb43 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_job_configuration.mdx @@ -0,0 +1,23 @@ +
+Integration configuration (click to expand) +```yaml showLineNumbers + createMissingRelatedEntities: true + deleteDependentEntities: true + resources: + - kind: job + selector: + query: "true" + port: + entity: + mappings: + identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] + title: .fullName + blueprint: '"jenkinsJob"' + properties: + jobName: .name + url: .url + jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' + timestamp: .time + parentJob: .__parentJob +``` +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_blueprint.mdx new file mode 100644 index 0000000000..98b1d73020 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_blueprint.mdx @@ -0,0 +1,65 @@ +
+Stage blueprint (click to expand) + +```json showLineNumbers +{ + "identifier": "jenkinsStage", + "description": "This blueprint represents a stage in a Jenkins build", + "title": "Jenkins Stage", + "icon": "Jenkins", + "schema": { + "properties": { + "status": { + "type": "string", + "title": "Stage Status", + "enum": [ + "SUCCESS", + "FAILURE", + "UNSTABLE", + "ABORTED", + "IN_PROGRESS", + "NOT_BUILT", + "PAUSED_PENDING_INPUT" + ], + "enumColors": { + "SUCCESS": "green", + "FAILURE": "red", + "UNSTABLE": "yellow", + "ABORTED": "darkGray", + "IN_PROGRESS": "blue", + "NOT_BUILT": "lightGray", + "PAUSED_PENDING_INPUT": "orange" + } + }, + "startTimeMillis": { + "type": "number", + "title": "Start Time (ms)", + "description": "Timestamp in milliseconds when the stage started" + }, + "durationMillis": { + "type": "number", + "title": "Duration (ms)", + "description": "Duration of the stage in milliseconds" + }, + "stageUrl": { + "type": "string", + "title": "Stage URL", + "description": "URL to the stage" + } + }, + "required": [] + }, + "mirrorProperties": {}, + "calculationProperties": {}, + "relations": { + "parentBuild": { + "title": "Jenkins Build", + "target": "jenkinsBuild", + "required": true, + "many": false + } + } +} +``` + +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_configuration.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_configuration.mdx new file mode 100644 index 0000000000..aeb4e851b3 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_stage_configuration.mdx @@ -0,0 +1,83 @@ +
+Integration configuration (click to expand) + +:::note Control Stage Fetching +To prevent overwhelming your Ocean instance with potentially thousands of stages from Jenkins, the integration requires you to specify a specific job. This ensures that Ocean only retrieves stages related to that job, keeping things focused and efficient. + +**Important**: The integration will also fetch stages from all nested jobs within the specified job. +::: + +```yaml showLineNumbers +- kind: stage + selector: + query: 'true' + # Example jobUrl - replace with your own Jenkins job URL + jobUrl: http://your-jenkins-server/job/your-project/job/your-job + port: + entity: + mappings: + identifier: >- + ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | + gsub("%252F"; "-") | gsub("/"; "-") + title: .name + blueprint: '"jenkinsStage"' + properties: + status: .status + startTimeMillis: .startTimeMillis + durationMillis: .durationMillis + stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href + relations: + parentBuild: >- + ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; + "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | + gsub("/"; "-") +# Additional stage configurations follow the same pattern. +- kind: stage + selector: + query: 'true' + # Example jobUrl - replace with your own Jenkins job URL + jobUrl: http://your-jenkins-server/job/your-project/job/another-job + port: + entity: + mappings: + identifier: >- + ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | + gsub("%252F"; "-") | gsub("/"; "-") + title: .name + blueprint: '"jenkinsStage"' + properties: + status: .status + startTimeMillis: .startTimeMillis + durationMillis: .durationMillis + stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href + relations: + parentBuild: >- + ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; + "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | + gsub("/"; "-") + +- kind: stage + selector: + query: 'true' + # Example jobUrl - replace with your own Jenkins job URL + jobUrl: http://your-jenkins-server/job/your-project/job/third-job + port: + entity: + mappings: + identifier: >- + ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | + gsub("%252F"; "-") | gsub("/"; "-") + title: .name + blueprint: '"jenkinsStage"' + properties: + status: .status + startTimeMillis: .startTimeMillis + durationMillis: .durationMillis + stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href + relations: + parentBuild: >- + ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; + "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | + gsub("/"; "-") +``` +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_blueprint.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_blueprint.mdx new file mode 100644 index 0000000000..59fe9949a8 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_blueprint.mdx @@ -0,0 +1,32 @@ +
+User blueprint (click to expand) + +```json showLineNumbers +{ + "identifier": "jenkinsUser", + "description": "This blueprint represents a jenkins user", + "title": "Jenkins User", + "icon": "Jenkins", + "schema": { + "properties": { + "url": { + "type": "string", + "title": "URL", + "format": "url" + }, + "lastUpdateTime": { + "type": "string", + "format": "date-time", + "title": "Last Update", + "description": "Last updated timestamp of the user" + } + }, + "required": [] + }, + "mirrorProperties": {}, + "calculationProperties": {}, + "relations": {} +} +``` + +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_configuration.mdx b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_configuration.mdx new file mode 100644 index 0000000000..cb4819ab05 --- /dev/null +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/_example_jenkins_user_configuration.mdx @@ -0,0 +1,21 @@ +
+Integration configuration (click to expand) +```yaml showLineNumbers +createMissingRelatedEntities: true +deleteDependentEntities: true +resources: + - kind: user + selector: + query: "true" + port: + entity: + mappings: + identifier: .user.id + title: .user.fullName + blueprint: '"jenkinsUser"' + properties: + url: .user.absoluteUrl + lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") + +``` +
\ No newline at end of file diff --git a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/jenkins.md b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/jenkins.md index e47f6fca69..f2985c6545 100644 --- a/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/jenkins.md +++ b/docs/build-your-software-catalog/sync-data-to-catalog/cicd/jenkins/jenkins.md @@ -11,8 +11,15 @@ import AdvancedConfig from '../../../../generalTemplates/_ocean_advanced_configu import PortApiRegionTip from "/docs/generalTemplates/_port_region_parameter_explanation_template.md" import OceanSaasInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_saas_installation.mdx" import JenkinsBuildBlueprint from './\_example_jenkins_build_blueprint.mdx' +import JenkinsBuildIntegration from './\_example_jenkins_build_configuration.mdx' import JenkinsBuildWebhookConfig from './\_example_jenkins_build_webhook_configuration.mdx' import JenkinsJobBlueprint from './\_example_jenkins_job_blueprint.mdx' +import JenkinsJobIntegration from './\_example_jenkins_job_configuration.mdx' +import JenkinsUserBlueprint from './\_example_jenkins_user_blueprint.mdx' +import JenkinsUserIntegration from './\_example_jenkins_user_configuration.mdx' +import JenkinsStageBlueprint from './\_example_jenkins_stage_blueprint.mdx' +import JenkinsStageIntegration from './\_example_jenkins_stage_configuration.mdx' +import JenkinsDefaultConfig from './\_example_jenkins_default_mapping_configuration.mdx' import JenkinsJobWebhookConfig from './\_example_jenkins_job_webhook_configuration.mdx' import OceanRealtimeInstallation from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_ocean_realtime_installation.mdx" import MetricsAndSyncStatus from "/docs/build-your-software-catalog/sync-data-to-catalog/templates/_metrics_and_sync_status.mdx" @@ -430,60 +437,7 @@ The mapping makes use of the [JQ JSON processor](https://stedolan.github.io/jq/m This is the default mapping configuration for this integration: -
-Default mapping configuration (Click to expand) - -```yaml showLineNumbers -createMissingRelatedEntities: true -deleteDependentEntities: true -resources: -- kind: job - selector: - query: 'true' - port: - entity: - mappings: - identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] - title: .fullName - blueprint: '"jenkinsJob"' - properties: - jobName: .name - url: .url - jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' - timestamp: .time - parentJob: .__parentJob -- kind: build - selector: - query: 'true' - port: - entity: - mappings: - identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] - title: .displayName - blueprint: '"jenkinsBuild"' - properties: - buildStatus: .result - buildUrl: .url - buildDuration: .duration - timestamp: .timestamp / 1000 | todate - relations: - parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") - previousBuild: .previousBuild.url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | gsub("/"; "-") | .[:-1] -- kind: user - selector: - query: 'true' - port: - entity: - mappings: - identifier: .user.id - title: .user.fullName - blueprint: '"jenkinsUser"' - properties: - url: .user.absoluteUrl - lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") -``` - -
+ @@ -494,403 +448,31 @@ Examples of blueprints and the relevant integration configurations: ### Job -
-Job blueprint - -```json showLineNumbers -{ - "identifier": "jenkinsJob", - "description": "This blueprint represents a job in Jenkins", - "title": "Jenkins Job", - "icon": "Jenkins", - "schema": { - "properties": { - "jobName": { - "type": "string", - "title": "Job Name" - }, - "jobStatus": { - "type": "string", - "title": "Job Status", - "enum": [ - "created", - "unknown", - "passing", - "failing" - ], - "enumColors": { - "passing": "green", - "created": "darkGray", - "failing": "red", - "unknown": "orange" - } - }, - "timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp", - "description": "Last updated timestamp of the job" - }, - "url": { - "type": "string", - "title": "Project URL" - }, - "parentJob": { - "type": "object", - "title": "Parent Job" - } - }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": {} -} -``` - -
- -
-Integration configuration + -```yaml showLineNumbers -createMissingRelatedEntities: true -deleteDependentEntities: true -resources: - - kind: job - selector: - query: "true" - port: - entity: - mappings: - identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] - title: .fullName - blueprint: '"jenkinsJob"' - properties: - jobName: .name - url: .url - jobStatus: '{"notbuilt": "created", "blue": "passing", "red": "failing"}[.color]' - timestamp: .time - parentJob: .__parentJob -``` - -
+ ### Build :::note Build Limit -The integration fetches up to 100 builds per Jenkins job, allowing you to view the 100 latest builds in Port for each job. +By default, the integration fetches up to 100 builds per Jenkins job. This limit is configurable using the `maxBuildsPerJob` selector. See the configuration options below for more details. ::: -
-Build blueprint - -```yaml showLineNumbers -{ - "identifier": "jenkinsBuild", - "description": "This blueprint represents a build event from Jenkins", - "title": "Jenkins Build", - "icon": "Jenkins", - "schema": { - "properties": { - "buildStatus": { - "type": "string", - "title": "Build Status", - "enum": [ - "SUCCESS", - "FAILURE", - "UNSTABLE" - ], - "enumColors": { - "SUCCESS": "green", - "FAILURE": "red", - "UNSTABLE": "yellow" - } - }, - "buildUrl": { - "type": "string", - "title": "Build URL", - "description": "URL to the build" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "title": "Timestamp", - "description": "Last updated timestamp of the build" - }, - "buildDuration": { - "type": "number", - "title": "Build Duration", - "description": "Duration of the build" - } - }, - "required": [] - }, - "mirrorProperties": { - "previousBuildStatus": { - "title": "Previous Build Status", - "path": "previousBuild.buildStatus" - } - }, - "calculationProperties": {}, - "relations": { - "parentJob": { - "title": "Jenkins Job", - "target": "jenkinsJob", - "required": false, - "many": false - }, - "previousBuild": { - "title": "Previous Build", - "target": "jenkinsBuild", - "required": false, - "many": false - } - } -} -``` - -
- -
-Integration configuration - -```yaml showLineNumbers -createMissingRelatedEntities: true -deleteDependentEntities: true -resources: - - kind: build - selector: - query: "true" - port: - entity: - mappings: - identifier: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] - title: .displayName - blueprint: '"jenkinsBuild"' - properties: - buildStatus: .result - buildUrl: .url - buildDuration: .duration - timestamp: '.timestamp / 1000 | todate' - relations: - parentJob: .url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] | gsub("-[0-9]+$"; "") - previousBuild: .previousBuild.url | split("://")[1] | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("/"; "-") | .[:-1] -``` + -
+ ### User -
-User blueprint - -```json showLineNumbers -{ - "identifier": "jenkinsUser", - "description": "This blueprint represents a jenkins user", - "title": "Jenkins User", - "icon": "Jenkins", - "schema": { - "properties": { - "url": { - "type": "string", - "title": "URL", - "format": "url" - }, - "lastUpdateTime": { - "type": "string", - "format": "date-time", - "title": "Last Update", - "description": "Last updated timestamp of the user" - } - }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": {} -} -``` - -
- -
-Integration configuration - -```yaml showLineNumbers -createMissingRelatedEntities: true -deleteDependentEntities: true -resources: - - kind: user - selector: - query: "true" - port: - entity: - mappings: - identifier: .user.id - title: .user.fullName - blueprint: '"jenkinsUser"' - properties: - url: .user.absoluteUrl - lastUpdateTime: if .lastChange then (.lastChange/1000) else now end | strftime("%Y-%m-%dT%H:%M:%SZ") - -``` + -
+ ### Stage -
-Stage blueprint + -```json showLineNumbers -{ - "identifier": "jenkinsStage", - "description": "This blueprint represents a stage in a Jenkins build", - "title": "Jenkins Stage", - "icon": "Jenkins", - "schema": { - "properties": { - "status": { - "type": "string", - "title": "Stage Status", - "enum": [ - "SUCCESS", - "FAILURE", - "UNSTABLE", - "ABORTED", - "IN_PROGRESS", - "NOT_BUILT", - "PAUSED_PENDING_INPUT" - ], - "enumColors": { - "SUCCESS": "green", - "FAILURE": "red", - "UNSTABLE": "yellow", - "ABORTED": "darkGray", - "IN_PROGRESS": "blue", - "NOT_BUILT": "lightGray", - "PAUSED_PENDING_INPUT": "orange" - } - }, - "startTimeMillis": { - "type": "number", - "title": "Start Time (ms)", - "description": "Timestamp in milliseconds when the stage started" - }, - "durationMillis": { - "type": "number", - "title": "Duration (ms)", - "description": "Duration of the stage in milliseconds" - }, - "stageUrl": { - "type": "string", - "title": "Stage URL", - "description": "URL to the stage" - } - }, - "required": [] - }, - "mirrorProperties": {}, - "calculationProperties": {}, - "relations": { - "parentBuild": { - "title": "Jenkins Build", - "target": "jenkinsBuild", - "required": true, - "many": false - } - } -} -``` - -
- -
-Integration configuration - -:::note Control Stage Fetching -To prevent overwhelming your Ocean instance with potentially thousands of stages from Jenkins, the integration requires you to specify a specific job. This ensures that Ocean only retrieves stages related to that job, keeping things focused and efficient. - -**Important**: The integration will also fetch stages from all nested jobs within the specified job. -::: - -```yaml showLineNumbers -- kind: stage - selector: - query: 'true' - # Example jobUrl - replace with your own Jenkins job URL - jobUrl: http://your-jenkins-server/job/your-project/job/your-job - port: - entity: - mappings: - identifier: >- - ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | - gsub("%252F"; "-") | gsub("/"; "-") - title: .name - blueprint: '"jenkinsStage"' - properties: - status: .status - startTimeMillis: .startTimeMillis - durationMillis: .durationMillis - stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href - relations: - parentBuild: >- - ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; - "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | - gsub("/"; "-") -# Additional stage configurations follow the same pattern. -# Make sure to replace the jobUrl with your own Jenkins job URLs for each configuration. -- kind: stage - selector: - query: 'true' - # Example jobUrl - replace with your own Jenkins job URL - jobUrl: http://your-jenkins-server/job/your-project/job/another-job - port: - entity: - mappings: - identifier: >- - ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | - gsub("%252F"; "-") | gsub("/"; "-") - title: .name - blueprint: '"jenkinsStage"' - properties: - status: .status - startTimeMillis: .startTimeMillis - durationMillis: .durationMillis - stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href - relations: - parentBuild: >- - ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; - "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | - gsub("/"; "-") -- kind: stage - selector: - query: 'true' - # Example jobUrl - replace with your own Jenkins job URL - jobUrl: http://your-jenkins-server/job/your-project/job/third-job - port: - entity: - mappings: - identifier: >- - ._links.self.href | sub("^.*?/"; "") | gsub("%20"; "-") | - gsub("%252F"; "-") | gsub("/"; "-") - title: .name - blueprint: '"jenkinsStage"' - properties: - status: .status - startTimeMillis: .startTimeMillis - durationMillis: .durationMillis - stageUrl: env.OCEAN__INTEGRATION__CONFIG__JENKINS_HOST + ._links.self.href - relations: - parentBuild: >- - ._links.self.href | sub("/execution/node/[0-9]+/wfapi/describe$"; - "") | sub("^.*?/"; "") | gsub("%20"; "-") | gsub("%252F"; "-") | - gsub("/"; "-") -``` - -
+ ## Let's Test It @@ -901,7 +483,7 @@ This section includes a sample response data from Jenkins. In addition, it inclu Here is an example of the payload structure from Jenkins:
-Job response data +Job response data (click to expand) ```json showLineNumbers { @@ -942,7 +524,7 @@ Here is an example of the payload structure from Jenkins:
-Build response data +Build response data (click to expand) ```json showLineNumbers { @@ -961,7 +543,7 @@ Here is an example of the payload structure from Jenkins:
-User response data +User response data (click to expand) ```json showLineNumbers { @@ -978,7 +560,7 @@ Here is an example of the payload structure from Jenkins:
-Stage response data +Stage response data (click to expand) ```json showLineNumbers { @@ -1004,7 +586,7 @@ Here is an example of the payload structure from Jenkins: The combination of the sample payload and the Ocean configuration generates the following Port entity:
-Job entity +Job entity (click to expand) ```json showLineNumbers { @@ -1029,7 +611,7 @@ The combination of the sample payload and the Ocean configuration generates the
-Build entity +Build entity (click to expand) ```json showLineNumbers { @@ -1056,7 +638,7 @@ The combination of the sample payload and the Ocean configuration generates the
-User entity +User entity (click to expand) ```json showLineNumbers { @@ -1079,7 +661,7 @@ The combination of the sample payload and the Ocean configuration generates the
-Stage entity +Stage entity (click to expand) ```json showLineNumbers {