depot/third_party/nixpkgs/pkgs/development/tools/replay-io/update.sh
Default email 3a4df29a92 Project import generated by Copybara.
GitOrigin-RevId: 3d7435c638baffaa826b85459df0fff47f12317d
2022-06-16 19:23:12 +02:00

32 lines
994 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq gnused
set -euo pipefail
# e.g. linux-gecko-20220331-59d0a686993f-ffd8d6280276
BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay.json | jq .buildId -r)
REVISION=$(echo $BUILD_ID | sed 's/^.*-//')
NODE_BUILD_ID=$(curl https://static.replay.io/downloads/linux-replay-node.json | jq .buildId -r)
REPLAY_DL=https://static.replay.io/downloads/${BUILD_ID}.tar.bz2
LIB_DL=https://static.replay.io/downloads/linux-recordreplay-${REVISION}.tgz
NODE_DL=https://static.replay.io/downloads/${NODE_BUILD_ID}
cat >"${BASH_SOURCE%/*}/meta.json" <<EOF
{
"replay": {
"url": "${REPLAY_DL}",
"sha256": "$(nix-prefetch-url --type sha256 "${REPLAY_DL}")"
},
"recordreplay": {
"url": "${LIB_DL}",
"sha256": "$(nix-prefetch-url --type sha256 --unpack "${LIB_DL}")",
"stripRoot": false
},
"replay-node": {
"url": "${NODE_DL}",
"sha256": "$(nix-prefetch-url --type sha256 "${NODE_DL}")"
}
}
EOF