rauhala.info/support/deploy-rauhala-info.sh

34 lines
503 B
Bash
Raw Normal View History

2021-11-26 21:47:20 +02:00
#!@bash@/bin/bash
set -e
2021-11-26 23:40:33 +02:00
nix build .#rauhala-info
2021-11-26 21:47:20 +02:00
API=/ip4/127.0.0.1/tcp/5001
function upload() {
echo "Uploading.."
2021-11-26 23:40:33 +02:00
hash=$(ipfs --api $API add -r result/share --pin=false -Q)
2021-11-26 21:47:20 +02:00
}
function pin() {
echo "Pinning"
ipfs --api $API pin remote rm --service=pinata --cid="$hash"
ipfs --api $API pin remote add --service=pinata --name=rauhala.info "$hash"
}
function publish() {
echo "Updating name"
ipfs --api $API name publish --key=rauhala.info "$hash"
}
upload
pin &
publish &
wait