mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
Check provider database with CI
scripts/update-provider-database.sh checks out the provider database and updates data.rs file, making it easier to update. CI uses this script to check that checked in data.rs corresponds to the provider database repository.
This commit is contained in:
22
scripts/update-provider-database.sh
Executable file
22
scripts/update-provider-database.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Updates provider database.
|
||||
# Returns 1 if the database is changed, 0 otherwise.
|
||||
set -euo pipefail
|
||||
|
||||
export TZ=UTC
|
||||
|
||||
# Provider database revision.
|
||||
REV=3c8f7e846c915a183dc44536fb5480d1f25d7c42
|
||||
|
||||
CORE_ROOT="$PWD"
|
||||
TMP="$(mktemp -d)"
|
||||
git clone --filter=blob:none https://github.com/deltachat/provider-db.git "$TMP"
|
||||
cd "$TMP"
|
||||
git checkout "$REV"
|
||||
DATE=$(git show -s --format=%cs)
|
||||
"$CORE_ROOT"/scripts/update-provider-database.py "$TMP/_providers" "$DATE" >"$CORE_ROOT/src/provider/data.rs"
|
||||
rustfmt "$CORE_ROOT/src/provider/data.rs"
|
||||
rm -fr "$TMP"
|
||||
|
||||
cd "$CORE_ROOT"
|
||||
test -z "$(git status --porcelain src/provider/data.rs)"
|
||||
Reference in New Issue
Block a user