ipfs-shipyard / ipfs-dns-deploy

A circleci friendly Docker image for pinning things to cluster and updating dns
https://hub.docker.com/r/ipfs/ipfs-dns-deploy/tags
MIT License
38 stars 4 forks source link

feat: better error reporting #10

Closed olizilla closed 4 years ago

olizilla commented 4 years ago

with this change failure to pin to cluster will show the command and error message

ipfs-cluster-ctl --host /dnsaddr/cluster.ipfs.io --basic-auth *** add --quieter --local --cid-version 1 --name 'test' --recursive .
An error occurred:
  Code: 401
  Message: Unauthorized
Failed to pin to cluster

failure to update github status will show the status code and request params used

curl: (22) The requested URL returned error: 401 Unauthorized
https://api.github.com/repos/ipfs-shipyard/ipfs-dns-deploy/statuses/8b93d943439f97ef9251bcea9bf292874ad1b04d {"state":"pending","target_url":"https://ipfs.io/","description":"Pinnning to IPFS cluster","context":"IPFS"}
Failed to update github status

License: MIT Signed-off-by: Oli Evans oli@tableflip.io

olizilla commented 4 years ago

I have tested this locally from docker with an incorrect github token to trigger a curl error and incorrect cluster auth to trigger a cluster error, as well as that the happy path still results in just the CID being printed.

I'm gonna merge this, but if you get a chance to sanity check it, many thanks!