Skip to content

Commit cd898a6

Browse files
Merge pull request #25 from dell/fix/version-sync-defaults-yaml
Fix version sync: update defaults.yaml to 5.1.0 and add validation
2 parents 75aa6d6 + 9dfab5d commit cd898a6

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

engine/config/defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ run:
109109
node: false
110110
port: 9999
111111
scenario: null
112-
version: 5.0.2
112+
version: 5.1.0
113113

114114
log:
115115
level: info

engine/core/spt-base/src/main/resources/config/defaults.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ run:
115115
node: false
116116
port: 9999
117117
scenario: null
118-
version: 5.0.2
118+
version: 5.1.0
119119

120120
log:
121121
level: info

scripts/release/check_version_sync.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,23 @@ check_contains "engine/bundle/build.gradle" "rootProject.ext.SPT_VERSION"
7878
check_contains "engine/bundle/Dockerfile" "ARG SPT_VERSION="
7979
check_contains "engine/bundle/Dockerfile" "LABEL version=\"\${SPT_VERSION}\""
8080

81+
# Check that defaults.yaml contains the correct version
82+
# This is critical because spt-base/build.gradle reads version from defaults.yaml
83+
check_version_in_yaml() {
84+
local file="$1"
85+
if [[ ! -f "${ROOT_DIR}/${file}" ]]; then
86+
errors+=("Expected file ${file} not found")
87+
return
88+
fi
89+
local yaml_version
90+
yaml_version=$(grep -E '^\s*version:\s*' "${ROOT_DIR}/${file}" | tail -1 | sed 's/.*version:\s*//' | tr -d '[:space:]')
91+
if [[ -n "${REPO_VERSION}" && "${yaml_version}" != "${REPO_VERSION}" ]]; then
92+
errors+=("Version in ${file} is '${yaml_version}' but VERSION file has '${REPO_VERSION}'")
93+
fi
94+
}
95+
96+
check_version_in_yaml "engine/core/spt-base/src/main/resources/config/defaults.yaml"
97+
8198
if [[ "${#errors[@]}" -gt 0 ]]; then
8299
printf 'Version sync check failed:\n' >&2
83100
for err in "${errors[@]}"; do

0 commit comments

Comments
 (0)