jreleaser-cdevents

This extension provides integration with CDEvents. It registers a WorkflowListener, triggering cdevents events as a result.

GAV Coordinates

org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0
  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

extensions:
  jreleaser-cdevents:
    enabled: true
    gav: org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0
[extensions.jreleaser-cdevents]
  enabled = true
  gav = "org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0"
{
  "extensions": {
    "jreleaser-cdevents": {
      "enabled": true,
      "gav": "org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0"
    }
  }
}
<jreleaser>
  <extensions>
    <jreleaser-cdevents>
      <enabled>true</enabled>
      <gav>org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0</gav>
    </jreleaser-cdevents>
  </extensions>
</jreleaser>
jreleaser {
  extensions {
    jreleaser-cdevents {
      enabled = true
      gav = 'org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0'
    }
  }
}

Configuration Properties

Name Required Type Description

continueOnError

boolean

Halt execution on failure if false, continue if true.

mode

enum

Start a new pipeline (CREATE) or join an existing pipeline (JOIN).

source

String

Pipeline source.

subject.id

String

Pipeline identifier.

subject.url

String

Pipeline url.

subject.source

String

URL of the pipeline source.

subject.pipeline.name

String

Name of the pipeline.

subject.pipeline.run.id

String

Pipeline run identifier.

subject.errors

String

Title for errors.

endpoint

String

Endpoint where events should be sent.

You may use System properties or environment variables to configure many of these properties instead of defining their explicit values in the configuration file. Refer to the following mappings:

Name System Property Environment Variable

mode

jreleaser.cdevents.mode

JRELEASER_CDEVENTS_MODE

source

jreleaser.cdevents.source

JRELEASER_CDEVENTS_SOURCE

subjectId

jreleaser.cdevents.subject.id

JRELEASER_CDEVENTS_SUBJECT_ID

subjectUrl

jreleaser.cdevents.subject.url

JRELEASER_CDEVENTS_SUBJECT_URL

subjectSource

jreleaser.cdevents.subject.source

JRELEASER_CDEVENTS_SUBJECT_SOURCE

subjectPipelineName

jreleaser.cdevents.subject.pipeline.name

JRELEASER_CDEVENTS_SUBJECT_PIPELINE_NAME

subjectPipelineRunId

jreleaser.cdevents.subject.pipeline.run.id

JRELEASER_CDEVENTS_SUBJECT_PIPELINE_RUN_ID

subjectErrors

jreleaser.cdevents.subject.errors

JRELEASER_CDEVENTS_SUBJECT_ERRORS

endpoint

jreleaser.cdevents.endpoint

JRELEASER_CDEVENTS_ENDPOINT

Usage

Events will be pumped to the configured endpoint.

Example

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

extensions:
  jreleaser-cdevents:
    enabled: true
    gav: org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0
    providers:
      - type: org.jreleaser.extensions.cdevents.CDEventsWorkflowListener
        properties:
          source: http://dev.cdevents
          subjectId: /dev/pipeline/run/1
          subjectUrl: http://dev.pipeline.run/url
          subjectSource: http://dev.pipeline.run/source
          subjectPipelineName: MyPipeline
          subjectPipelineRunId: 1
          subjectErrors: pipelineErrors
          endpoint: http://localhost:8080/dcevents/sink
[extensions.jreleaser-cdevents]
  enabled = true
  gav = "org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0"
  [[extensions.jreleaser-cdevents.providers]]
    type = "org.jreleaser.extensions.cdevents.CDEventsWorkflowListener"
    properties.source = "http://dev.cdevents"
    properties.subjectId = "/dev/pipeline/run/1"
    properties.subjectUrl = "http://dev.pipeline.run/url"
    properties.subjectSource = "http://dev.pipeline.run/source"
    properties.subjectPipelineName = "MyPipeline"
    properties.subjectPipelineRunId = "1"
    properties.subjectErrors = "pipelineErrors"
    properties.endpoint = "http://localhost:8080/dcevents/sink"
{
  "extensions": {
    "jreleaser-cdevents": {
      "enabled": true,
      "gav": "org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0",
      "providers": [
        {
          "type": "org.jreleaser.extensions.cdevents.CDEventsWorkflowListener",
          "properties": {
            "source": "http://dev.cdevents",
            "subjectId": "/dev/pipeline/run/1",
            "subjectUrl": "http://dev.pipeline.run/url",
            "subjectSource": "http://dev.pipeline.run/source",
            "subjectPipelineName": "MyPipeline",
            "subjectPipelineRunId": "1",
            "subjectErrors": "pipelineErrors",
            "endpoint": "http://localhost:8080/dcevents/sink"
          }
        }
      ]
    }
  }
}
<jreleaser>
  <extensions>
    <jreleaser-cdevents>
      <enabled>true</enabled>
      <gav>org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0</gav>
      <providers>
        <provider>
          <type>org.jreleaser.extensions.cdevents.CDEventsWorkflowListenertype</type>
          <properties>
            <source>http://dev.cdevents</source>
            <subjectId>/dev/pipeline/run/1</subjectId>
            <subjectUrl>http://dev.pipeline.run/url</subjectUrl>
            <subjectSource>http://dev.pipeline.run/source</subjectSource>
            <subjectPipelineName>MyPipeline</subjectPipelineName>
            <subjectPipelineRunId>1</subjectPipelineRunId>
            <subjectErrors>pipelineErrors</subjectErrors>
            <endpoint>http://localhost:8080/dcevents/sink</endpoint>
          </properties>
        </provider>
      </providers>
    </jreleaser-cdevents>
  </extensions>
</jreleaser>
jreleaser {
  extensions {
    jreleaser-cdevents {
      enabled = true
      gav = 'org.jreleaser.extensions:jreleaser-cdevents-extension:1.0.0'
      provider {
        type = 'org.jreleaser.extensions.cdevents.CDEventsWorkflowListener'
        properties = [
          source: 'http://dev.cdevents',
          subjectId: '/dev/pipeline/run/1',
          subjectUrl: 'http://dev.pipeline.run/url',
          subjectSource: 'http://dev.pipeline.run/source',
          subjectPipelineName: 'MyPipeline',
          subjectPipelineRunId: '1',
          subjectErrors: 'pipelineErrors',
          endpoint: 'http://localhost:8080/dcevents/sink'
        ]
      }
    }
  }
}