-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgenerate.sh
More file actions
executable file
·47 lines (37 loc) · 1.03 KB
/
Copy pathgenerate.sh
File metadata and controls
executable file
·47 lines (37 loc) · 1.03 KB
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
38
39
40
41
42
43
44
45
46
#!/bin/bash
if ! docker info > /dev/null 2>&1; then
echo "Error: Docker is not running. Please start Docker and try again."
exit 1
fi
VERSION=$(jq -r '.version' package.json)
while getopts "v:" arg; do
case $arg in
v)
VERSION=$OPTARG
;;
esac
done
# Make prerelease version compatible with PEP 440
if [[ $VERSION =~ (.*-test\.)([0-9]+) ]]; then
BASE_VERSION=${BASH_REMATCH[1]}
DEV_NUMBER=${BASH_REMATCH[2]}
VERSION="${BASE_VERSION%-rc.}.rc${DEV_NUMBER}"
fi
# Cleanup
rm -Rf fingerprint_server_sdk
rm -Rf docs
OPENAPI_GENERATOR_IMAGE_VERSION="v7.19.0"
docker run --rm -u "$(id -u):$(id -g)" -v "${PWD}:/local" -w /local "openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_IMAGE_VERSION}" generate \
-i ./res/fingerprint-server-api.yaml \
-g python \
-o ./ \
-t ./template \
-c ./config.json \
--additional-properties=packageVersion="$VERSION"
if [ $? -ne 0 ]; then
echo "Error: Code generation failed."
exit 1
fi
# Linting and formatting
uv run ruff format .
uv run ruff check --fix --unsafe-fixes .