-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlint-versions.sh
More file actions
executable file
·37 lines (31 loc) · 974 Bytes
/
lint-versions.sh
File metadata and controls
executable file
·37 lines (31 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# Immediate exit on failure
set -e
echo ">> Linting SDK module versions..."
# Check all pyproject.toml files
for file in $(find . -print | sed 's|^./||' | grep -E "(^services/[^/]+/pyproject.toml$|^core/pyproject.toml$)"); do
# Extract the current version
dirpath=$(dirname "$file")
version=$(scripts/helper.sh "$dirpath")
# skip iaasalpha
case "$dirpath" in
"services/iaasalpha")
continue
;;
esac
# special handling for CDN (is in v2 by accident)
if [[ "$dirpath" == "services/cdn" ]]; then
if [[ ! "$version" =~ ^v?[0-2]\.[0-9]+\.[0-9]+$ ]]; then
echo ">> $dirpath"
echo "The version '$version' is invalid."
exit 1
fi
continue
fi
# verify version
if [[ ! "$version" =~ ^v?[0-1]\.[0-9]+\.[0-9]+$ ]]; then
echo ">> $dirpath"
echo "The version '$version' is invalid."
exit 1
fi
done