File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,8 @@ lint-services:
2525 flake8 --toml-config core/pyproject.toml --black-config core/pyproject.toml examples;
2626 # lint services
2727 @for f in $(shell ls ${SERVICES_DIR}) ; do set -e; cd ${SERVICES_DIR} /$$ {f}; poetry install --no-root --only dev; flake8 . ; cd ../..; done
28+ # lint versions
29+ @./scripts/lint-versions.sh
2830
2931test :
3032 echo " Testing service ${service} "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Immediate exit on failure
4+ set -e
5+
6+ echo " >> Linting SDK module versions..."
7+
8+ # Check all pyproject.toml files
9+ for file in $( find . -print | sed ' s|^./||' | grep -E " (^services/[^/]+/pyproject.toml$|^core/pyproject.toml$)" ) ; do
10+ # Extract the current version
11+ dirpath=$( dirname " $file " )
12+ version=$( scripts/helper.sh " $dirpath " )
13+
14+ # skip iaasalpha
15+ case " $dirpath " in
16+ " services/iaasalpha" )
17+ continue
18+ ;;
19+ esac
20+
21+ # special handling for CDN (is in v2 by accident)
22+ if [[ " $dirpath " == " services/cdn" ]]; then
23+ if [[ ! " $version " =~ ^v[0-2]\. [0-9]+\. [0-9]+$ ]]; then
24+ echo " >> $dirpath "
25+ echo " The version '$version ' is invalid."
26+ exit 1
27+ fi
28+ continue
29+ fi
30+
31+ # verify version
32+ if [[ ! " $version " =~ ^v[0-1]\. [0-9]+\. [0-9]+$ ]]; then
33+ echo " >> $dirpath "
34+ echo " The version '$version ' is invalid."
35+ exit 1
36+ fi
37+ done
You can’t perform that action at this time.
0 commit comments