rauhala.info/support/deploy-rauhala-info.sh
2021-11-26 23:40:33 +02:00

34 lines
503 B
Bash
Executable File

#!@bash@/bin/bash
set -e
nix build .#rauhala-info
API=/ip4/127.0.0.1/tcp/5001
function upload() {
echo "Uploading.."
hash=$(ipfs --api $API add -r result/share --pin=false -Q)
}
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