Deploying via ipfs?
This commit is contained in:
36
support/deploy-rauhala-info.sh
Executable file
36
support/deploy-rauhala-info.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!@bash@/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ ! -d _site ]; then
|
||||
echo "No _site detected"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
API=/ip4/127.0.0.1/tcp/5001
|
||||
|
||||
function upload() {
|
||||
echo "Uploading.."
|
||||
hash=$(ipfs --api $API add -r _site --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
|
||||
|
||||
|
Reference in New Issue
Block a user