aboutsummaryrefslogtreecommitdiffstats
path: root/extra/container_count_update/update_prod.sh
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-04-08 12:04:41 -0700
committerBryan Newbold <bnewbold@robocracy.org>2022-04-08 12:04:41 -0700
commit156d04dac507e089a8b2a321094bb205bc67e1c1 (patch)
tree505b12c7e6ac65385c87fcf64a61778ad4945d60 /extra/container_count_update/update_prod.sh
parentede98644a89afd15d903061e0998dbd08851df6d (diff)
downloadfatcat-156d04dac507e089a8b2a321094bb205bc67e1c1.tar.gz
fatcat-156d04dac507e089a8b2a321094bb205bc67e1c1.zip
container status: add simple prod single-command script
Diffstat (limited to 'extra/container_count_update/update_prod.sh')
-rwxr-xr-xextra/container_count_update/update_prod.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/extra/container_count_update/update_prod.sh b/extra/container_count_update/update_prod.sh
new file mode 100755
index 00000000..766398f2
--- /dev/null
+++ b/extra/container_count_update/update_prod.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+export CONTAINER_INDEX=fatcat_container_v05_20220110
+
+fatcat-cli search container --index-json --limit 0 state:active \
+ | jq .ident -r \
+ | pv -l \
+ > container_idents.tsv
+
+cat container_idents.tsv \
+ | parallel -j10 curl --fail -s 'https://fatcat.wiki/container/{}/stats.json' \
+ | jq -c . \
+ | pv -l \
+ > container_stats.json
+
+cat container_stats.json \
+ | jq '{ ident: .ident, releases_total: .total, preservation_bright: .preservation.bright, preservation_dark: .preservation.dark, preservation_shadows_only: .preservation.shadows_only, preservation_none: .preservation.none }' -c \
+ | esbulk -verbose -index $CONTAINER_INDEX -optype update -id ident