在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/ipfs-dns-deploy开源软件地址:https://github.com/ipfs-shipyard/ipfs-dns-deploy开源编程语言:Shell 74.2%开源软件介绍:ipfs-dns-deploy
Use this image to add a site to IPFS as part of a circleci build and deploy workflow. This image contains:
What it does
$ ipfs dns libp2p.io
/ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW or, if you want to be double sure, you can ask dig $ dig _dnslink.libp2p.io -t TXT +short
"dnslink=/ipfs/QmaYRVyPKpN8FXy9HS1t9Zhtjo4RpYXgiuNj1ins9fiLuW" UsageThis
version: 2
jobs:
build:
docker:
- image: circleci/node:10.15.1
steps:
- checkout
- run:
command: npm ci
- run:
command: npm run build
- persist_to_workspace:
root: .
paths:
- build
deploy:
docker:
- image: olizilla/ipfs-dns-deploy
environment:
DOMAIN: peerpad.net
DEV_DOMAIN: dev.peerpad.net
BUILD_DIR: build
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Add to IPFS
command: |
pin_name="$DOMAIN build $CIRCLE_BUILD_NUMBER"
hash=$(pin-to-cluster.sh "$pin_name" /tmp/workspace/$BUILD_DIR)
echo "Website added to IPFS: https://ipfs.io/ipfs/$hash"
# Update DNSlink prod domain when there's a new version
if [ npx semver "$CIRCLE_TAG" ] ; then
dnslink-dnsimple -d $DOMAIN -r _dnslink -l /ipfs/$hash
fi
# Always update DNSlink dev domain
if [ "$CIRCLE_BRANCH" == "master" ] ; then
dnslink-dnsimple -d $DEV_DOMAIN -r _dnslink -l /ipfs/$hash
fi
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
context: ipfs-dns-deploy
requires:
- build
You can get creative with the dns updating. In this example, changes to the RequirementsThe following environment variables must be set CLUSTER_USER="<beep>"
CLUSTER_PASSWORD="<boop>"
GITHUB_TOKEN="<needs repo status scope>"
DNSIMPLE_TOKEN="<from an account that controls your domain>" To simplify secret management, set them in a circleci The script assumes it will have access to the circleci variables # Provided by circleci. Example values shown, yours will be different.
CIRCLE_PROJECT_USERNAME="ipfs-shipyard"
CIRCLE_PROJECT_REPONAME="peer-pad"
CIRCLE_SHA1="f818cb08e0e79fcc203f4d52a1a1dd7c3c832a64"
CIRCLE_BUILD_NUMBER="1870" Optionally you can provide any of the following env vars: # set the cluster host to pin to.
CLUSTER_HOST="/dns/a-cluster-of-ones-own"
# pass extra flags to ipfs-cluster-ctl
EXTRA_IPFS_CLUSTER_ARGS="--hidden" Setting up a new org
Other examplesPin to cluster and update the PR with the pin status. docker run \
-e CLUSTER_USER="beep" \
-e CLUSTER_PASSWORD="boop" \
-e GITHUB_TOKEN="xyz" \
-e CIRCLE_PROJECT_USERNAME="ipfs-shipyard" \
-e CIRCLE_PROJECT_REPONAME="peer-pad" \
-e CIRCLE_SHA1="f818cb08e0e79fcc203f4d52a1a1dd7c3c832a64" \
-e EXTRA_IPFS_CLUSTER_ARGS="--hidden" \
-v build:/tmp/build \
olizilla/ipfs-dns-deploy \
pin-to-cluster.sh "dev.peerpad.net" ./build Update the DNSLink for a domain via dnslink-dnsimple docker run \
-e DNSIMPLE_TOKEN="beep" \
olizilla/ipfs-dns-deploy \
dnslink-dnsimple -d $DOMAIN -l /ipfs/$HASH -r _dnslink Updating the Docker imageTo rebuild the image docker build -t olizilla/ipfs-dns-deploy --build-arg GIT_COMMIT=$(git rev-parse HEAD) .
...
Successfully tagged olizilla/ipfs-dns-deploy:latest To push a new image to docker hub, login to docker, then docker tag olizilla/ipfs-dns-deploy:latest olizilla/ipfs-dns-deploy:1.0
# push the new tag
docker push olizilla/ipfs-dns-deploy:1.0
# update latest
docker push olizilla/ipfs-dns-deploy:latest ContributeFeel free to dive in! Open an issue or submit PRs. To contribute to IPFS in general, see the contributing guide. LicenseMIT © Protocol Labs |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论