diff --git a/README.md b/README.md index 529da3f6..853c960c 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ points for metrics. ## CDEvents Specification The latest release of the specification on is -[v0.1.2](https://github.com/cdevents/spec/blob/v0.1.2/spec.md), and you can +[v0.2.0](https://github.com/cdevents/spec/blob/v0.2.0/spec.md), and you can continuously follow the latest updates of the specification on [the `main` branch](./spec.md). diff --git a/cloudevents-binding.md b/cloudevents-binding.md index cbe5affb..96730ffe 100644 --- a/cloudevents-binding.md +++ b/cloudevents-binding.md @@ -102,7 +102,7 @@ Content-Length: nnnn { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id" : "A234-1234-1234", "source" : "/staging/tekton/", "type" : "dev.cdevents.taskrun.started", diff --git a/continuous-operations.md b/continuous-operations.md index c26b36d1..69a05b9b 100644 --- a/continuous-operations.md +++ b/continuous-operations.md @@ -40,7 +40,7 @@ An `incident` represents a problem in a production environment. This event represents an incident that has been detected by a system or human. -- Event Type: __`dev.cdevents.incident.detected.0.1.0-draft`__ +- Event Type: __`dev.cdevents.incident.detected.0.1.0`__ - Predicate: detected - Subject: [`incident`](#incident) @@ -58,7 +58,7 @@ This event represents an incident that has been detected by a system or human. This event represents an incident that has been reported through a ticketing system. Compared to the `detected` predicated, it introduces a ticket URI. -- Event Type: __`dev.cdevents.incident.reported.0.1.0-draft`__ +- Event Type: __`dev.cdevents.incident.reported.0.1.0`__ - Predicate: reported - Subject: [`incident`](#incident) @@ -77,7 +77,7 @@ This event represents an incident that has been reported through a ticketing sys This event represents an incident that has been resolved, meaning that the problem identified by the incident has been solved or recalled. -- Event Type: __`dev.cdevents.incident.resolved.0.1.0-draft`__ +- Event Type: __`dev.cdevents.incident.resolved.0.1.0`__ - Predicate: resolved - Subject: [`incident`](#incident) diff --git a/examples/incidentdetected.json b/examples/incidentdetected.json index c49f4e34..840b8420 100644 --- a/examples/incidentdetected.json +++ b/examples/incidentdetected.json @@ -1,9 +1,9 @@ { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id": "F4BD2B55-B6F6-4F44-AF72-BD2D0E7A8708", "source": "/monitoring/prod1", - "type": "dev.cdevents.incident.detected.0.1.0-draft", + "type": "dev.cdevents.incident.detected.0.1.0", "timestamp": "2022-11-11T13:52:20.079Z" }, "subject": { diff --git a/examples/incidentreported.json b/examples/incidentreported.json index ea994930..f8c9294b 100644 --- a/examples/incidentreported.json +++ b/examples/incidentreported.json @@ -1,9 +1,9 @@ { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id": "F4BD2B55-B6F6-4F44-AF72-BD2D0E7A8708", "source": "/monitoring/prod1", - "type": "dev.cdevents.incident.reported.0.1.0-draft", + "type": "dev.cdevents.incident.reported.0.1.0", "timestamp": "2022-11-11T13:52:20.079Z" }, "subject": { diff --git a/examples/incidentresolved.json b/examples/incidentresolved.json index c15ce6df..7b6368ab 100644 --- a/examples/incidentresolved.json +++ b/examples/incidentresolved.json @@ -1,9 +1,9 @@ { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id": "F4BD2B55-B6F6-4F44-AF72-BD2D0E7A8708", "source": "/monitoring/prod1", - "type": "dev.cdevents.incident.resolved.0.1.0-draft", + "type": "dev.cdevents.incident.resolved.0.1.0", "timestamp": "2022-11-11T13:52:20.079Z" }, "subject": { diff --git a/schemas/artifactpackaged.json b/schemas/artifactpackaged.json index e9a80330..7d3c89db 100644 --- a/schemas/artifactpackaged.json +++ b/schemas/artifactpackaged.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/artifact-packaged-event", + "$id": "https://cdevents.dev/0.2.0/schema/artifact-packaged-event", "properties": { "context": { "properties": { diff --git a/schemas/artifactpublished.json b/schemas/artifactpublished.json index 4d31b64e..7e984cba 100644 --- a/schemas/artifactpublished.json +++ b/schemas/artifactpublished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/artifact-published-event", + "$id": "https://cdevents.dev/0.2.0/schema/artifact-published-event", "properties": { "context": { "properties": { diff --git a/schemas/branchcreated.json b/schemas/branchcreated.json index d55c3024..710445f9 100644 --- a/schemas/branchcreated.json +++ b/schemas/branchcreated.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/branch-created-event", + "$id": "https://cdevents.dev/0.2.0/schema/branch-created-event", "properties": { "context": { "properties": { diff --git a/schemas/branchdeleted.json b/schemas/branchdeleted.json index 66548fcd..ad68d8df 100644 --- a/schemas/branchdeleted.json +++ b/schemas/branchdeleted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/branch-deleted-event", + "$id": "https://cdevents.dev/0.2.0/schema/branch-deleted-event", "properties": { "context": { "properties": { diff --git a/schemas/buildfinished.json b/schemas/buildfinished.json index 2d8aa360..0b5c71de 100644 --- a/schemas/buildfinished.json +++ b/schemas/buildfinished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/build-finished-event", + "$id": "https://cdevents.dev/0.2.0/schema/build-finished-event", "properties": { "context": { "properties": { diff --git a/schemas/buildqueued.json b/schemas/buildqueued.json index 3ffc6561..48c013a6 100644 --- a/schemas/buildqueued.json +++ b/schemas/buildqueued.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/build-queued-event", + "$id": "https://cdevents.dev/0.2.0/schema/build-queued-event", "properties": { "context": { "properties": { diff --git a/schemas/buildstarted.json b/schemas/buildstarted.json index 41788d24..b9fec0fa 100644 --- a/schemas/buildstarted.json +++ b/schemas/buildstarted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/build-started-event", + "$id": "https://cdevents.dev/0.2.0/schema/build-started-event", "properties": { "context": { "properties": { diff --git a/schemas/changeabandoned.json b/schemas/changeabandoned.json index addb9536..6758a7b3 100644 --- a/schemas/changeabandoned.json +++ b/schemas/changeabandoned.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/change-abandoned-event", + "$id": "https://cdevents.dev/0.2.0/schema/change-abandoned-event", "properties": { "context": { "properties": { diff --git a/schemas/changecreated.json b/schemas/changecreated.json index dda7bd51..1ee3a837 100644 --- a/schemas/changecreated.json +++ b/schemas/changecreated.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/change-created-event", + "$id": "https://cdevents.dev/0.2.0/schema/change-created-event", "properties": { "context": { "properties": { diff --git a/schemas/changemerged.json b/schemas/changemerged.json index 5a7a1c13..e8afe0c5 100644 --- a/schemas/changemerged.json +++ b/schemas/changemerged.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/change-merged-event", + "$id": "https://cdevents.dev/0.2.0/schema/change-merged-event", "properties": { "context": { "properties": { diff --git a/schemas/changereviewed.json b/schemas/changereviewed.json index 75bacca6..8b5a308d 100644 --- a/schemas/changereviewed.json +++ b/schemas/changereviewed.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/change-reviewed-event", + "$id": "https://cdevents.dev/0.2.0/schema/change-reviewed-event", "properties": { "context": { "properties": { diff --git a/schemas/changeupdated.json b/schemas/changeupdated.json index 239e630a..3124bf8e 100644 --- a/schemas/changeupdated.json +++ b/schemas/changeupdated.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/change-updated-event", + "$id": "https://cdevents.dev/0.2.0/schema/change-updated-event", "properties": { "context": { "properties": { diff --git a/schemas/environmentcreated.json b/schemas/environmentcreated.json index 36184cb6..9c88c11e 100644 --- a/schemas/environmentcreated.json +++ b/schemas/environmentcreated.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/environment-created-event", + "$id": "https://cdevents.dev/0.2.0/schema/environment-created-event", "properties": { "context": { "properties": { diff --git a/schemas/environmentdeleted.json b/schemas/environmentdeleted.json index f1cce7df..e62aec3a 100644 --- a/schemas/environmentdeleted.json +++ b/schemas/environmentdeleted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/environment-deleted-event", + "$id": "https://cdevents.dev/0.2.0/schema/environment-deleted-event", "properties": { "context": { "properties": { diff --git a/schemas/environmentmodified.json b/schemas/environmentmodified.json index ff920bb8..31bc9115 100644 --- a/schemas/environmentmodified.json +++ b/schemas/environmentmodified.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/environment-modified-event", + "$id": "https://cdevents.dev/0.2.0/schema/environment-modified-event", "properties": { "context": { "properties": { diff --git a/schemas/incidentdetected.json b/schemas/incidentdetected.json index d4ef48c4..7f2dba3e 100644 --- a/schemas/incidentdetected.json +++ b/schemas/incidentdetected.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/incident-detected-event", + "$id": "https://cdevents.dev/0.2.0/schema/incident-detected-event", "properties": { "context": { "properties": { @@ -20,9 +20,9 @@ "type": { "type": "string", "enum": [ - "dev.cdevents.incident.detected.0.1.0-draft" + "dev.cdevents.incident.detected.0.1.0" ], - "default": "dev.cdevents.incident.detected.0.1.0-draft" + "default": "dev.cdevents.incident.detected.0.1.0" }, "timestamp": { "type": "string", diff --git a/schemas/incidentreported.json b/schemas/incidentreported.json index 292f82f8..74a38f37 100644 --- a/schemas/incidentreported.json +++ b/schemas/incidentreported.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/incident-reported-event", + "$id": "https://cdevents.dev/0.2.0/schema/incident-reported-event", "properties": { "context": { "properties": { @@ -20,9 +20,9 @@ "type": { "type": "string", "enum": [ - "dev.cdevents.incident.reported.0.1.0-draft" + "dev.cdevents.incident.reported.0.1.0" ], - "default": "dev.cdevents.incident.reported.0.1.0-draft" + "default": "dev.cdevents.incident.reported.0.1.0" }, "timestamp": { "type": "string", diff --git a/schemas/incidentresolved.json b/schemas/incidentresolved.json index fa1975ee..774e2f2a 100644 --- a/schemas/incidentresolved.json +++ b/schemas/incidentresolved.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/incident-resolved-event", + "$id": "https://cdevents.dev/0.2.0/schema/incident-resolved-event", "properties": { "context": { "properties": { @@ -20,9 +20,9 @@ "type": { "type": "string", "enum": [ - "dev.cdevents.incident.resolved.0.1.0-draft" + "dev.cdevents.incident.resolved.0.1.0" ], - "default": "dev.cdevents.incident.resolved.0.1.0-draft" + "default": "dev.cdevents.incident.resolved.0.1.0" }, "timestamp": { "type": "string", diff --git a/schemas/pipelinerunfinished.json b/schemas/pipelinerunfinished.json index 9bb09c4e..c67c265a 100644 --- a/schemas/pipelinerunfinished.json +++ b/schemas/pipelinerunfinished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/pipeline-run-finished-event", + "$id": "https://cdevents.dev/0.2.0/schema/pipeline-run-finished-event", "properties": { "context": { "properties": { diff --git a/schemas/pipelinerunqueued.json b/schemas/pipelinerunqueued.json index 63fe66de..91cae0d0 100644 --- a/schemas/pipelinerunqueued.json +++ b/schemas/pipelinerunqueued.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/pipeline-run-queued-event", + "$id": "https://cdevents.dev/0.2.0/schema/pipeline-run-queued-event", "properties": { "context": { "properties": { diff --git a/schemas/pipelinerunstarted.json b/schemas/pipelinerunstarted.json index 3cf745c2..18465d95 100644 --- a/schemas/pipelinerunstarted.json +++ b/schemas/pipelinerunstarted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/pipeline-run-started-event", + "$id": "https://cdevents.dev/0.2.0/schema/pipeline-run-started-event", "properties": { "context": { "properties": { diff --git a/schemas/repositorycreated.json b/schemas/repositorycreated.json index 8960029f..aa25b981 100644 --- a/schemas/repositorycreated.json +++ b/schemas/repositorycreated.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/repository-created-event", + "$id": "https://cdevents.dev/0.2.0/schema/repository-created-event", "properties": { "context": { "properties": { diff --git a/schemas/repositorydeleted.json b/schemas/repositorydeleted.json index 2026d6ee..2341d9c5 100644 --- a/schemas/repositorydeleted.json +++ b/schemas/repositorydeleted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/repository-deleted-event", + "$id": "https://cdevents.dev/0.2.0/schema/repository-deleted-event", "properties": { "context": { "properties": { diff --git a/schemas/repositorymodified.json b/schemas/repositorymodified.json index 3db6df2a..1d68f21e 100644 --- a/schemas/repositorymodified.json +++ b/schemas/repositorymodified.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/repository-modified-event", + "$id": "https://cdevents.dev/0.2.0/schema/repository-modified-event", "properties": { "context": { "properties": { diff --git a/schemas/servicedeployed.json b/schemas/servicedeployed.json index 5ecb5534..8a11ad1c 100644 --- a/schemas/servicedeployed.json +++ b/schemas/servicedeployed.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/service-deployed-event", + "$id": "https://cdevents.dev/0.2.0/schema/service-deployed-event", "properties": { "context": { "properties": { diff --git a/schemas/servicepublished.json b/schemas/servicepublished.json index 230094b9..abcc7866 100644 --- a/schemas/servicepublished.json +++ b/schemas/servicepublished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/service-published-event", + "$id": "https://cdevents.dev/0.2.0/schema/service-published-event", "properties": { "context": { "properties": { diff --git a/schemas/serviceremoved.json b/schemas/serviceremoved.json index f7f07c21..5c64087f 100644 --- a/schemas/serviceremoved.json +++ b/schemas/serviceremoved.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/service-removed-event", + "$id": "https://cdevents.dev/0.2.0/schema/service-removed-event", "properties": { "context": { "properties": { diff --git a/schemas/servicerolledback.json b/schemas/servicerolledback.json index f9933528..7fc4af22 100644 --- a/schemas/servicerolledback.json +++ b/schemas/servicerolledback.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/service-rolledback-event", + "$id": "https://cdevents.dev/0.2.0/schema/service-rolledback-event", "properties": { "context": { "properties": { diff --git a/schemas/serviceupgraded.json b/schemas/serviceupgraded.json index 64505867..e682dadc 100644 --- a/schemas/serviceupgraded.json +++ b/schemas/serviceupgraded.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/service-upgraded-event", + "$id": "https://cdevents.dev/0.2.0/schema/service-upgraded-event", "properties": { "context": { "properties": { diff --git a/schemas/taskrunfinished.json b/schemas/taskrunfinished.json index c0324451..e303341d 100644 --- a/schemas/taskrunfinished.json +++ b/schemas/taskrunfinished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/task-run-finished-event", + "$id": "https://cdevents.dev/0.2.0/schema/task-run-finished-event", "properties": { "context": { "properties": { diff --git a/schemas/taskrunstarted.json b/schemas/taskrunstarted.json index 53b99fa3..3472fad9 100644 --- a/schemas/taskrunstarted.json +++ b/schemas/taskrunstarted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/task-run-started-event", + "$id": "https://cdevents.dev/0.2.0/schema/task-run-started-event", "properties": { "context": { "properties": { diff --git a/schemas/testcasefinished.json b/schemas/testcasefinished.json index f90ad985..38763749 100644 --- a/schemas/testcasefinished.json +++ b/schemas/testcasefinished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/test-case-finished-event", + "$id": "https://cdevents.dev/0.2.0/schema/test-case-finished-event", "properties": { "context": { "properties": { diff --git a/schemas/testcasequeued.json b/schemas/testcasequeued.json index 0095411b..b2a7589b 100644 --- a/schemas/testcasequeued.json +++ b/schemas/testcasequeued.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/test-case-queued-event", + "$id": "https://cdevents.dev/0.2.0/schema/test-case-queued-event", "properties": { "context": { "properties": { diff --git a/schemas/testcasestarted.json b/schemas/testcasestarted.json index 89673407..37114881 100644 --- a/schemas/testcasestarted.json +++ b/schemas/testcasestarted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/test-case-started-event", + "$id": "https://cdevents.dev/0.2.0/schema/test-case-started-event", "properties": { "context": { "properties": { diff --git a/schemas/testsuitefinished.json b/schemas/testsuitefinished.json index 3c6a5c47..847650b2 100644 --- a/schemas/testsuitefinished.json +++ b/schemas/testsuitefinished.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/test-suite-finished-event", + "$id": "https://cdevents.dev/0.2.0/schema/test-suite-finished-event", "properties": { "context": { "properties": { diff --git a/schemas/testsuitestarted.json b/schemas/testsuitestarted.json index 3284e894..1e388efc 100644 --- a/schemas/testsuitestarted.json +++ b/schemas/testsuitestarted.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://cdevents.dev/0.2.0-draft/schema/test-suite-started-event", + "$id": "https://cdevents.dev/0.2.0/schema/test-suite-started-event", "properties": { "context": { "properties": { diff --git a/spec.md b/spec.md index 30e32c27..6a7d5ceb 100644 --- a/spec.md +++ b/spec.md @@ -269,7 +269,7 @@ This is an example of a full CDEvent context, rendered in JSON format: ```json { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id" : "A234-1234-1234", "source" : "/staging/tekton/", "type" : "dev.cdevents.taskrun.started", @@ -354,7 +354,7 @@ The following example shows `context` and `subject` together, rendered as JSON. ```json { "context": { - "version": "0.2.0-draft", + "version": "0.2.0", "id" : "A234-1234-1234", "source" : "/staging/tekton/", "type" : "dev.cdevents.taskrun.started", diff --git a/tools/event-version.sh b/tools/event-version.sh index dc21033f..9a2f5a73 100755 --- a/tools/event-version.sh +++ b/tools/event-version.sh @@ -106,9 +106,10 @@ SPLIT_EVENT=(${EVENT_SUBJECT_PREDICATE//./ }) SUBJECT=${SPLIT_EVENT[0]} PREDICATE=${SPLIT_EVENT[1]} SCHEMA_FILE="schemas/${SUBJECT}${PREDICATE}.json" +EXAMPLE_FILE="examples/${SUBJECT}${PREDICATE}.json" # Evaluate the event version -OLD_VERSION=$(sed -n -e '/"default": "dev.cdevents.'${SUBJECT}'.'${PREDICATE}'./s/.*\.\([0-9]\.[0-9]\.[0-9]\)"/\1/p' ${SCHEMA_FILE}) +OLD_VERSION=$(sed -n -e '/"default": "dev.cdevents.'${SUBJECT}'.'${PREDICATE}'./s/.*\.\([0-9]\.[0-9]\.[0-9]\(-draft\)\{0,1\}\)"/\1/p' ${SCHEMA_FILE}) VERSION="${NEW_VERSION:-$OLD_VERSION}" SPLIT_VERSION=(${VERSION//./ }) MAJOR_VERSION=${SPLIT_VERSION[0]} @@ -157,6 +158,11 @@ VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${DRAFT_VERSION}" # Replace the version in the schema IDs sed -i ".backup" -e 's,"dev.cdevents.*","dev.cdevents.'${SUBJECT}'.'${PREDICATE}'.'${VERSION}'",g' "${SCHEMA_FILE}" +# Replace the version in the example file +if [ -f "${EXAMPLE_FILE}" ]; then + sed -i ".backup" -e 's,"dev.cdevents.*","dev.cdevents.'${SUBJECT}'.'${PREDICATE}'.'${VERSION}'",g' "${EXAMPLE_FILE}" +fi + # Update examples in docs for doc in core source-code-version-control continuous-integration continuous-deployment continuous-operations; do sed -i ".backup" -e 's,__`dev.cdevents.'${SUBJECT}'.'${PREDICATE}'.*`__,__`dev.cdevents.'${SUBJECT}'.'${PREDICATE}'.'${VERSION}'`__,g' "${doc}.md" diff --git a/tools/spec-release.sh b/tools/spec-release.sh index c0f9043b..4dfc6288 100755 --- a/tools/spec-release.sh +++ b/tools/spec-release.sh @@ -147,6 +147,10 @@ VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${DRAFT_VERSION}" find schemas -name '*json' | \ xargs sed -i ".backup" -e 's,https://cdevents.dev/'${OLD_VERSION}'/schema/,https://cdevents.dev/'${VERSION}'/schema/,g' +# Replace the version in the examples +find examples -name '*json' | \ + xargs sed -i ".backup" -e 's,"version": "'${OLD_VERSION}'","version": "'${VERSION}'",g' + # Update examples in docs for doc in cloudevents-binding spec; do sed -i ".backup" -e 's;"version": "'${OLD_VERSION}'",;"version": "'${VERSION}'",;g' "${doc}.md" diff --git a/version.txt b/version.txt index 96184634..0ea3a944 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.0-draft +0.2.0