mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-24 10:55:56 +00:00
Hash check and retry for pictrs binary (#5345)
* Hash check and retry for pictrs binary * retry limit
This commit is contained in:
parent
a531e384b1
commit
4e46332bf4
1 changed files with 18 additions and 6 deletions
|
@ -13,13 +13,25 @@ export RUST_LOG="warn,lemmy_server=$LEMMY_LOG_LEVEL,lemmy_federate=$LEMMY_LOG_LE
|
||||||
|
|
||||||
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
|
export LEMMY_TEST_FAST_FEDERATION=1 # by default, the persistent federation queue has delays in the scale of 30s-5min
|
||||||
|
|
||||||
# pictrs setup
|
PICTRS_PATH="api_tests/pict-rs"
|
||||||
if [ ! -f "api_tests/pict-rs" ]; then
|
PICTRS_EXPECTED_HASH="8feb52c0dee1dd0b41caa0e92afd9d5e597fbb4d7174d7bba22a1ba72fa01dbc pict-rs"
|
||||||
# This one sometimes goes down
|
|
||||||
# curl "https://git.asonix.dog/asonix/pict-rs/releases/download/v0.5.16/pict-rs-linux-amd64" -o api_tests/pict-rs
|
# Pictrs setup. Download file with hash check and up to 3 retries.
|
||||||
curl "https://codeberg.org/asonix/pict-rs/releases/download/v0.5.6/pict-rs-linux-amd64" -o api_tests/pict-rs
|
if [ ! -f "$PICTRS_PATH" ]; then
|
||||||
chmod +x api_tests/pict-rs
|
retry=true
|
||||||
|
count=0
|
||||||
|
while $retry && [ "$count" -lt 3 ]
|
||||||
|
do
|
||||||
|
# This one sometimes goes down
|
||||||
|
# curl "https://git.asonix.dog/asonix/pict-rs/releases/download/v0.5.16/pict-rs-linux-amd64" -o "$PICTRS_PATH"
|
||||||
|
curl "https://codeberg.org/asonix/pict-rs/releases/download/v0.5.5/pict-rs-linux-amd64" -o "$PICTRS_PATH"
|
||||||
|
PICTRS_HASH=$(sha256sum "$PICTRS_PATH")
|
||||||
|
[[ "$PICTRS_HASH" != "$PICTRS_EXPECTED_HASH" ]] && retry=true || retry=false
|
||||||
|
let count=count+1
|
||||||
|
done
|
||||||
|
chmod +x "$PICTRS_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./api_tests/pict-rs \
|
./api_tests/pict-rs \
|
||||||
run -a 0.0.0.0:8080 \
|
run -a 0.0.0.0:8080 \
|
||||||
--danger-dummy-mode \
|
--danger-dummy-mode \
|
||||||
|
|
Loading…
Reference in a new issue