Skip to content

Commit 865a8be

Browse files
committed
Update tools with new files and folders
Signed-off-by: Andrea Frittoli <andrea.frittoli@gmail.com>
1 parent fe2ec0e commit 865a8be

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

tools/event-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ SPLIT_EVENT=(${EVENT_SUBJECT_PREDICATE//./ })
118118
SUBJECT=${SPLIT_EVENT[0]}
119119
PREDICATE=${SPLIT_EVENT[1]}
120120
SCHEMA_FILE="schemas/${SUBJECT}${PREDICATE}.json"
121-
EXAMPLE_FILE="examples/${SUBJECT}_${PREDICATE}.json"
121+
EXAMPLE_FILE="conformance/${SUBJECT}_${PREDICATE}.json"
122122

123123
# Evaluate the event version
124124
OLD_VERSION=$(sed -n -e '/"default": "dev.cdevents.'${SUBJECT}'.'${PREDICATE}'./s/.*\.\([0-9]\.[0-9]\.[0-9]\(-draft\)\{0,1\}\)"/\1/p' ${SCHEMA_FILE})
@@ -145,7 +145,7 @@ fi
145145
if [[ "${COMMAND}" == "${START_COMMAND}" ]]; then
146146
if [[ -n ${DRAFT_VERSION} ]]; then
147147
echo "Cannot start release ${VERSION}, already in ${DRAFT_VERSION}"
148-
# Still ensure examples are up to date with OLD_VERSION
148+
# Still ensure conformance files are up to date with OLD_VERSION
149149
VERSION=${OLD_VERSION}
150150
replace_example
151151
# Cleanup backup files

tools/spec-release.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,20 @@ VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${DRAFT_VERSION}"
147147
find schemas -name '*json' | \
148148
xargs sed -i ".backup" -e 's,https://cdevents.dev/'${OLD_VERSION}'/schema/,https://cdevents.dev/'${VERSION}'/schema/,g'
149149

150-
# Replace the version in the examples
151-
find examples -name '*json' | \
150+
# Replace the version in the conformance files
151+
find conformance -name '*json' | \
152152
xargs sed -i ".backup" -e 's,"version": "'${OLD_VERSION}'","version": "'${VERSION}'",g'
153153

154154
# Replace the version in the custom events schema ID
155155
find custom -name '*json' | \
156156
xargs sed -i ".backup" -e 's,https://cdevents.dev/'${OLD_VERSION}'/schema/,https://cdevents.dev/'${VERSION}'/schema/,g'
157157

158+
# Replace the version in the custom events conformance file
159+
find custom -name '*json' | \
160+
xargs sed -i ".backup" -e 's,"version": "'${OLD_VERSION}'","version": "'${VERSION}'",g'
158161

159162
# Update examples in docs
160-
for doc in cloudevents-binding spec; do
163+
for doc in cloudevents-binding spec links; do
161164
sed -i ".backup" -e 's;"version": "'${OLD_VERSION}'",;"version": "'${VERSION}'",;g' "${doc}.md"
162165
done
163166

0 commit comments

Comments
 (0)