Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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: webui.ipfs.io
BUILD_DIR: build
steps:
- attach_workspace:
at: /tmp/workspace
- run:
name: Pin website, post notification for PRs or update DNS on master
command: |
# Upload build dir to cluster.ipfs.io
hash=$(ipfs-cluster-ctl \
--host /dnsaddr/cluster.ipfs.io \
--basic-auth $CLUSTER_USER:$CLUSTER_PASSWORD \
add --rmin 3 --rmax 3 --name "$DOMAIN" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not set --rmin/--rmax, that way cluster's defaults will be used.. Also, if by chance you have the [short]-commit ID available, you could add it to the --name tag so there is more info.

--recursive /tmp/workspace/$BUILD_DIR | tail -n1 | cut -d " " -f 2 )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to use the --quietest or --Q option which only outputs the final hash, rather than tail ...


preview_url=https://ipfs.io/ipfs/$hash

echo "Website added to IPFS: $preview_url"

if [ ! -z "$CIRCLE_PULL_REQUEST" ] ; then
# Add website preview as PR Status - https://developer.github.com/v3/repos/statuses/#create-a-status

status_url="https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/statuses/$CIRCLE_SHA1"
params=$(jq --monochrome-output --null-input \
--arg target_url $preview_url \
'{ "state": "success", "target_url": $target_url, description: "Website added to IPFS", "context": "IPFS" }' )

echo "Github status update: $params"
curl --silent -X POST -H "Authorization: token $GITHUB_TOKEN" -H 'Content-Type: application/json' --data "$params" $status_url

elif [ "$CIRCLE_BRANCH" == "master" ] ; then
# Update DNSLink for domain

dnslink-dnsimple -d $DOMAIN -r _dnslink -l /ipfs/$hash

else
echo "Not a Pull Request or Master branch. Skipping."
fi

workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
context: ipfs-dns-deploy
requires:
- build
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_VERSION=$npm_package_version
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 8.12.0
- 10.15.1
env:
- NO_SANDBOX=true
install: npm ci
Expand Down
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

The IPFS WebUI is a **work-in-progress**. Help us make it better! We use the issues on this repo to track the work and it's part of the wider [IPFS GUI project](https://github.com/ipfs/ipfs-gui).

The app uses the IPFS HTTP CLIENT to get data from the ipfs node. It will use the `window.ipfs` api provided by the [IPFS Companion](https://github.com/ipfs-shipyard/ipfs-companion) web-extension where available, and fallback to using [js-ipfs-http-client](https://github.com/ipfs/js-ipfs-http-client) where not.
The app uses [`ipfs-http-client`](https://github.com/ipfs/js-ipfs-http-client) to communicate with your local IPFS node.

The app is built with [`create-react-app`](https://github.com/facebook/create-react-app). Please read the [docs](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#table-of-contents).

Expand Down
7 changes: 0 additions & 7 deletions ci/Jenkinsfile

This file was deleted.

5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import bundleCache from './lib/bundle-cache'
import { I18nextProvider } from 'react-i18next'
import i18n from './i18n'

const appVersion = process.env.REACT_APP_VERSION
const gitRevision = process.env.REACT_APP_GIT_REV

console.log(`IPFS Web UI - v${appVersion} - https://github.com/ipfs-shipyard/ipfs-webui/commit/${gitRevision}`)

async function render () {
const initialData = await bundleCache.getAll()
if (initialData && process.env.NODE_ENV !== 'production') {
Expand Down