diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/generate_api_client.sh | 13 | ||||
| -rwxr-xr-x | scripts/mkdb.sh | 2 | ||||
| -rwxr-xr-x | scripts/validate_api.sh | 10 |
3 files changed, 24 insertions, 1 deletions
diff --git a/scripts/generate_api_client.sh b/scripts/generate_api_client.sh new file mode 100755 index 0000000..a36bec0 --- /dev/null +++ b/scripts/generate_api_client.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env sh + +root="$(dirname "$0")/.." +api_path="$root/target/api.json" + +cargo run --package rocie-server -- open-api >"$api_path" + +openapi-generator-cli generate \ + --input-spec "$api_path" \ + --generator-name rust \ + --output "$root/crates/rocie-client" + +# vim: ft=sh diff --git a/scripts/mkdb.sh b/scripts/mkdb.sh index c9895f8..9e0aaae 100755 --- a/scripts/mkdb.sh +++ b/scripts/mkdb.sh @@ -17,7 +17,7 @@ db="${DATABASE_URL#sqlite://}" [ -f "$db" ] && rm "$db" [ -d "$root/target" ] || mkdir "$root/target" -fd . "$root/crates/yt/src/storage/migrate/sql" | while read -r sql_file; do +fd . "$root/crates/rocie-server/src/storage/migrate/sql" | while read -r sql_file; do echo "Applying sql migration file: $(basename "$sql_file").." { # NOTE(@bpeetz): The wrapping in a transaction is needed to simulate the rust code. <2025-05-07> diff --git a/scripts/validate_api.sh b/scripts/validate_api.sh new file mode 100755 index 0000000..056d550 --- /dev/null +++ b/scripts/validate_api.sh @@ -0,0 +1,10 @@ +#! /usr/bin/env sh + +root="$(dirname "$0")/.." +api_path="$root/target/api.json" + +cargo run --package rocie-server -- open-api >"$api_path" + +openapi-generator-cli validate --input-spec "$api_path" --recommend + +# vim: ft=sh |
