James Walker a9a96aee94
All checks were successful
continuous-integration/drone/push Build is passing
🐛 variables consistency
2023-02-04 23:05:14 -05:00

33 lines
936 B
Bash
Executable File

#!/usr/bin/env bash
set -e
HOST=${PLUGIN_CLUSTER_HOST:-"/dns4/cluster.walkah.cloud"}
# pin to cluster
root_cid=$(ipfs-cluster-ctl \
--host ${HOST} \
--basic-auth ${PLUGIN_CLUSTER_USER}:${PLUGIN_CLUSTER_PASSWORD} \
${PLUGIN_CLUSTER_ARGS} \
add \
--quieter \
--cid-version 1 \
--name ${PLUGIN_DOMAIN} \
--recursive \
--local \
${PLUGIN_EXTRA_ARGS} \
${PLUGIN_PATH} ) || {
echo "ipfs-cluster-ctl --host ${HOST} --basic-auth *** ${PLUGIN_CLUSTER_ARGS} add --quieter --local --cid-version 1 --name ${PLUGIN_DOMAIN} --recursive ${PLUGIN_PATH}" 1>&2
echo "$root_cid" 1>&2
echo "Failed to pin to cluster" 1>&2
false
}
echo "Deployed: $root_cid"
if [ ! -x ${PLUGIN_CF_EMAIL} ]; then
export CF_API_EMAIL=${PLUGIN_CF_EMAIL}
export CF_API_KEY=${PLUGIN_CF_APIKEY}
dnslink-cloudflare -d ${PLUGIN_DOMAIN} -l "/ipfs/${root_cid}" -r _dnslink
fi