🥅 better error handling
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
213ad94080
commit
8b3a587fa9
17
pin.sh
17
pin.sh
@ -1,4 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
HOST=${PLUGIN_CLUSTER_HOST:-"/dns4/cluster.walkah.cloud"}
|
HOST=${PLUGIN_CLUSTER_HOST:-"/dns4/cluster.walkah.cloud"}
|
||||||
|
|
||||||
@ -10,16 +12,21 @@ root_cid=$(ipfs-cluster-ctl \
|
|||||||
add \
|
add \
|
||||||
--quieter \
|
--quieter \
|
||||||
--cid-version 1 \
|
--cid-version 1 \
|
||||||
--name "${PLUGIN_DOMAIN}" \
|
--name "$PLUGIN_DOMAIN" \
|
||||||
--recursive \
|
--recursive \
|
||||||
--local \
|
--local \
|
||||||
$PLUGIN_EXTRA_ARGS \
|
$PLUGIN_EXTRA_ARGS \
|
||||||
"$PLUGIN_PATH" )
|
"$PLUGIN_PATH" ) || {
|
||||||
|
echo "ipfs-cluster-ctl --host $HOST --basic-auth *** $PLUGIN_CLUSTER_ARGS add --quieter --local --wait --cid-version 1 --name $PLUGIN_DOMAIN --recursive $PLUGIN_PATH"
|
||||||
|
echo "FAILED to pin"
|
||||||
|
false
|
||||||
|
}
|
||||||
|
echo "Deployed: $root_cid"
|
||||||
|
|
||||||
if [ ! -x "$PLUGIN_CF_EMAIL" ]; then
|
if [ ! -x "$PLUGIN_CF_EMAIL" ]; then
|
||||||
export CF_API_EMAIL=$PLUGIN_CF_EMAIL
|
export CF_API_EMAIL=$PLUGIN_CF_EMAIL
|
||||||
export CF_API_KEY=$PLUGIN_CF_APIKEY
|
export CF_API_KEY=$PLUGIN_CF_APIKEY
|
||||||
dnslink-cloudflare -d $PLUGIN_DOMAIN -l "/ipfs/${root_cid}"
|
dnslink-cloudflare -d $PLUGIN_DOMAIN -l "/ipfs/${root_cid}" -r _dnslink
|
||||||
|
echo "Updated $PLUGIN_DOMAIN"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Deployed: $root_cid"
|
|
Loading…
x
Reference in New Issue
Block a user