From 3d039d8ee3c12e3c425e3ecee5b0adfe398bb2a5 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 11 Dec 2015 14:46:22 +0100 Subject: [PATCH 01/36] Move docs around --- CONTRIBUTING.md | 95 +++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 82 +++--------------------------------------- site/README.md | 18 ---------- 3 files changed, 100 insertions(+), 95 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 site/README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..936b324b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,95 @@ +# Contributing + +## Development + +Harpjs setup with + +* Live reload using browser-sync +* JavaScript + * bundeling using webpack + * transpiling using babel +* Linting using eslint + + +```bash +$ gulp +$ open localhost:3000 +``` + + +## How this repo works + +The goal is to generate a file hierarchy that looks like this: + +``` +dist/index.html -- listing of all bundles available +dist/ -- all versions of +dist//README.md -- simple readme for +dist//latest -- points to latest +dist// -- dist version +dist///README.md -- readme for listing +dist///.tar.gz -- archive for +``` + +Definitions: +- `` is a distribution, meaning a program or library we release. +- `` is the version of the `` +- `` is a supported platform of `@` + +So for example, if we had `` `go-ipfs` and `native-app`, we might see a hierarchy like: + +``` +. +├── go-ipfs +│   ├── latest -> v0.3.7 +│   ├── v0.3.6 +│   │   ├── README.md +│   │   ├── go-ipfs_v0.3.6_darwin-386.tar.gz +│   │   ├── go-ipfs_v0.3.6_darwin-amd64.tar.gz +│   │   ├── go-ipfs_v0.3.6_linux-386.tar.gz +│   │   ├── go-ipfs_v0.3.6_linux-amd64.tar.gz +│   │   └── hashes +│   └── v0.3.7 +├── index.html +└── native-app + ├── latest -> v0.2.1 + └── v0.2.1 + ├── README.md +       ├── hashes + ├── ipfs-native-app_v0.2.1_linux.tar.gz + └── ipfs-native-app_v0.2.1_osx.zip + +7 directories, 11 files +``` + +We call this the **distribution index**, the listing of all distributions, their versions, and platform assets. + +Note how they each describe `` differently. This is likely to be inevitable as different platform identifiers will be used by different communities. + +### distribution index versions / updates + +The **distribution index** changes over time, kind of like a git repository. [Since we don't yet have commits](https://github.com/ipfs/notes/issues/23), we will just do a poor-man's versioning for the index itself. We will write all version hashes to a file `versions` in this repository. + +A site like `dist.ipfs.io` or `ipfs.io/dist` would just serve the _latest_ version of the index. + +### How assets are made + +Each `` has a directory in the root of this repo. inside it there is a `Makefile` and other necessary scripts. Running + +``` +make +``` + +Should: +- figure out what the latest released version is (from github tags) +- figure out what versions are missing from the index +- construct the missing `/` directories + +## Do it + +This project uses a makefile + scripts to build all the things. + +``` +make +``` +should do everything. diff --git a/README.md b/README.md index 37e47979..da74e659 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,8 @@ # IPFS distributions -> Source for building https://dist.ipfs.io - -## How this repo works - -The goal is to generate a file hierarchy that looks like this: - -``` -dist/index.html -- listing of all bundles available -dist/ -- all versions of -dist//README.md -- simple readme for -dist//latest -- points to latest -dist// -- dist version -dist///README.md -- readme for listing -dist///.tar.gz -- archive for -``` - -Definitions: -- `` is a distribution, meaning a program or library we release. -- `` is the version of the `` -- `` is a supported platform of `@` - -So for example, if we had `` `go-ipfs` and `native-app`, we might see a hierarchy like: - -``` -. -├── go-ipfs -│   ├── latest -> v0.3.7 -│   ├── v0.3.6 -│   │   ├── README.md -│   │   ├── go-ipfs_v0.3.6_darwin-386.tar.gz -│   │   ├── go-ipfs_v0.3.6_darwin-amd64.tar.gz -│   │   ├── go-ipfs_v0.3.6_linux-386.tar.gz -│   │   ├── go-ipfs_v0.3.6_linux-amd64.tar.gz -│   │   └── hashes -│   └── v0.3.7 -├── index.html -└── native-app - ├── latest -> v0.2.1 - └── v0.2.1 - ├── README.md -       ├── hashes - ├── ipfs-native-app_v0.2.1_linux.tar.gz - └── ipfs-native-app_v0.2.1_osx.zip - -7 directories, 11 files -``` - -We call this the **distribution index**, the listing of all distributions, their versions, and platform assets. - -Note how they each describe `` differently. This is likely to be inevitable as different platform identifiers will be used by different communities. +[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/freejs-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![Dependency Status](https://david-dm.org/ipfs/distributions.svg?style=flat-square)](https://david-dm.org/ipfs/distributions) +[![Travis CI](https://travis-ci.org/ipfs/distributions.svg?branch=master)](https://travis-ci.org/ipfs/distributions) +[![Circle CI](https://circleci.com/gh/ipfs/distributions.svg?style=svg)](https://circleci.com/gh/ipfs/distributions) -### distribution index versions / updates - -The **distribution index** changes over time, kind of like a git repository. [Since we don't yet have commits](https://github.com/ipfs/notes/issues/23), we will just do a poor-man's versioning for the index itself. We will write all version hashes to a file `versions` in this repository. - -A site like `dist.ipfs.io` or `ipfs.io/dist` would just serve the _latest_ version of the index. - -### How assets are made - -Each `` has a directory in the root of this repo. inside it there is a `Makefile` and other necessary scripts. Running - -``` -make -``` - -Should: -- figure out what the latest released version is (from github tags) -- figure out what versions are missing from the index -- construct the missing `/` directories - -## Do it - -This project uses a makefile + scripts to build all the things. - -``` -make -``` -should do everything. +> Source for building https://dist.ipfs.io diff --git a/site/README.md b/site/README.md deleted file mode 100644 index ab4db4fc..00000000 --- a/site/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# IPFS Distributions - - -## Development - -Harpjs setup with - -* Live reload using browser-sync -* JavaScript - * bundeling using webpack - * transpiling using babel -* Linting using eslint - - -```bash -$ gulp -$ open localhost:3000 -``` From 44ab3fd9427b5e4412ab5ca609a41c62e650ada1 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 11 Dec 2015 14:48:47 +0100 Subject: [PATCH 02/36] Add travis --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..ddd4195b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: node_js +node_js: + - '4' + - '5' + - stable + +script: + - npm run lint \ No newline at end of file From 54054d019e04fe77b1ab3b5e140dda297ab70593 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 11 Dec 2015 21:17:11 +0100 Subject: [PATCH 03/36] Add circle config --- circle.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 circle.yml diff --git a/circle.yml b/circle.yml new file mode 100644 index 00000000..95d89b18 --- /dev/null +++ b/circle.yml @@ -0,0 +1,7 @@ +machine: + node: + version: stable + +test: + override: + - npm run lint \ No newline at end of file From 74496ba6242e0c522f4bd5df50ce0ca4ec0d45ab Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 11 Dec 2015 21:18:09 +0100 Subject: [PATCH 04/36] Refactor go-ipfs build of dist.json --- .babelrc | 3 ++ dists/go-ipfs/dist.json | 18 ++++++++++-- dists/go-ipfs/go-ipfs-dist | 4 +-- dists/go-ipfs/mkdist.js | 30 ------------------- package.json | 9 ++++-- scripts/mkdist.js | 59 +++++++++++++++++++------------------- site/public/index.jade | 57 ++++++++++-------------------------- tasks/dist.js | 24 ++++++++++++++++ 8 files changed, 97 insertions(+), 107 deletions(-) create mode 100644 .babelrc delete mode 100755 dists/go-ipfs/mkdist.js create mode 100644 tasks/dist.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..c13c5f62 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/dists/go-ipfs/dist.json b/dists/go-ipfs/dist.json index 091f4994..79645e56 100644 --- a/dists/go-ipfs/dist.json +++ b/dists/go-ipfs/dist.json @@ -2,5 +2,19 @@ "id": "go-ipfs", "name": "go-ipfs", "tagline": "IPFS implementation and toolchain in Go", - "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n" -} \ No newline at end of file + "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n", + "platforms": { + "oses": [ + {"id": "darwin", "name": "Mac OSX App", "browser":"OS X", "icon": "apple"}, + {"id": "linux", "name": "Linux App", "browser":"Linux", "icon": "linux"}, + {"id": "openbsd", "name": "OpenBSD App", "browser":"OpenBSD", "icon": "circle-o"}, + {"id": "freebsd", "name": "FreeBSD App", "browser":"FreeBSD", "icon": "circle-o"}, + {"id": "windows", "name": "Windows App", "browser":"Windows", "icon": "windows"} + ], + "archs": [ + {"id": "386", "name": "32 bit", "browser": "32"}, + {"id": "amd64", "name": "64 bit", "browser": "64"}, + {"id": "arm", "name": "ARM", "browser": "ARM"} + ] + } +} diff --git a/dists/go-ipfs/go-ipfs-dist b/dists/go-ipfs/go-ipfs-dist index 505aad46..07b3b816 100755 --- a/dists/go-ipfs/go-ipfs-dist +++ b/dists/go-ipfs/go-ipfs-dist @@ -79,8 +79,8 @@ dist_version() { cd "$cwd" # generate dist.json file - echo "---> generating dist.json" - ./mkdist.js "$version" + echo "---> generating config for $version" + ../../node_modules/.bin/gulp dist "--path=$(pwd)" "--version=$version" } if [ "$1" = "all" ]; then diff --git a/dists/go-ipfs/mkdist.js b/dists/go-ipfs/mkdist.js deleted file mode 100755 index 2468894c..00000000 --- a/dists/go-ipfs/mkdist.js +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env node - -var mkdist = require('../../mkdist') - -if (process.argv.length != 3) { - console.log("usage: mkdist.js ") - process.exit(1) -} - -var dist = require('./dist.json') -dist.version = process.argv[2] - -mkdist({ - dist: dist, - path: "../..", - platforms: { - oses: [ - {id: 'darwin', name: "Mac OSX App", browser:'OS X', icon: 'apple'}, - {id: 'linux', name: "Linux App", browser:'Linux', icon: 'linux'}, - {id: 'openbsd', name: "OpenBSD App", browser:'OpenBSD', icon: 'circle-o'}, - {id: 'freebsd', name: "FreeBSD App", browser:'FreeBSD', icon: 'circle-o'}, - {id: 'windows', name: "Windows App", browser:'Windows', icon: 'windows'}, - ], - archs: [ - {id: '386', name: '32 bit', browser: '32'}, - {id: 'amd64', name: '64 bit', browser: '64'}, - {id: 'arm', name: 'ARM', browser: 'ARM'}, - ] - } -}) diff --git a/package.json b/package.json index 02d68ed1..dd7fd933 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "babel-loader": "^6.0.0", "babel-plugin-transform-remove-console": "^6.0.14", "babel-polyfill": "^6.0.14", - "babel-preset-es2015": "^6.0.15", + "babel-preset-es2015": "^6.3.13", "bootstrap": "^4.0.0-alpha.2", "browser-sync": "^2.10.0", "eslint": "^1.8.0", @@ -21,9 +21,11 @@ "gulp-batch": "^1.0.5", "gulp-eslint": "^1.1.1", "gulp-load-plugins": "^1.1.0", + "gulp-util": "^3.0.7", "gulp-watch": "^4.3.5", "harp": "^0.20.0", "jquery": "^2.1.4", + "mkdirp": "^0.5.1", "pre-commit": "^1.1.2", "require-dir": "^0.3.0", "tether": "^1.1.1", @@ -48,5 +50,8 @@ "homepage": "https://github.com/ipfs/distributions#readme", "pre-commit": [ "lint" - ] + ], + "engines": { + "node": "^4.0.0" + } } diff --git a/scripts/mkdist.js b/scripts/mkdist.js index ff13b6d0..98df27b8 100644 --- a/scripts/mkdist.js +++ b/scripts/mkdist.js @@ -1,30 +1,30 @@ -var fs = require('fs') +const fs = require('fs') +const {join} = require('path') +const mkdirp = require('mkdirp') + +const sitePath = join(__dirname, '..', 'site', 'public', 'releases') module.exports = mkdist function mkdist (opts, cb) { if (!opts) throw new Error('no options given') - if (!opts.dist) throw new Error('no dist given') - if (!opts.dist.id) throw new Error('no dist.id given') - if (!opts.dist.version) throw new Error('no dist.version given') - if (!opts.path) throw new Error('no path given') + if (!opts.id) throw new Error('no id given') + if (!opts.version) throw new Error('no version given') if (!opts.platforms) throw new Error('no platforms given') - if (!cb) cb = noopcb - var dist = opts.dist - var ver = dist.version + let ver = opts.version if (ver.match(/^v/)) ver = ver.substring(1) - dist.releaseLink = 'releases/' + dist.id + '/v' + ver - var releasePath = opts.path + '/' + dist.releaseLink - dist.platforms = [] + opts.releaseLink = `releases/${opts.id}/v${ver}` + const releasePath = join(__dirname, '..', opts.releaseLink) + opts.releases = [] - var dir = fs.readdirSync(releasePath) + const dir = fs.readdirSync(releasePath) // add osx installer - var f = findFile(/\.pkg$/) + const f = findFile(/\.pkg$/) if (f) { - dist.platforms.push({ + opts.releases.push({ id: 'osxpkg', name: 'Mac OSX Installer (.pkg)', icon: 'apple', @@ -38,31 +38,35 @@ function mkdist (opts, cb) { // TODO: windows msi installer // add standard os binaries - addOSBinaries(dir, opts.platforms, dist.platforms) + opts.releases = opts.releases.concat(addOSBinaries(dir, opts.platforms)) // add source - dist.platforms.push({ + opts.releases.push({ id: 'src', name: 'Source Code (.zip)', icon: 'archive', archs: [{ name: 'src', - link: dist.id + '_v' + ver + '_src.zip' + link: opts.id + '_v' + ver + '_src.zip' }] }) - writeDist(releasePath + '/dist.json', dist, function (err) { - if (err) return cb(err) - cb(null, dist) - }) + writeDist(opts) + cb() } -function writeDist (path, dist) { - fs.writeFileSync(path, JSON.stringify(dist, null, ' ')) - console.log('wrote', path) +function writeDist (dist) { + const targetPath = join(sitePath, dist.id, dist.version) + const targetJson = join(targetPath, '_data.json') + const targetMd = join(targetPath, 'index.md') + + mkdirp.sync(targetPath) + fs.writeFileSync(targetJson, JSON.stringify(dist, null, ' ')) + fs.writeFileSync(targetMd, dist.description) } -function addOSBinaries (dir, src, dst) { +function addOSBinaries (dir, src) { + const dst = [] for (var osi in src.oses) { var os = src.oses[osi] var p = { @@ -89,6 +93,7 @@ function addOSBinaries (dir, src, dst) { dst.push(p) // do have releases for this os. } } + return dst } @@ -100,7 +105,3 @@ function findFile (dir, pattern) { } return null } - -function noopcb (err) { - if (err) throw err -} diff --git a/site/public/index.jade b/site/public/index.jade index bca2b4cc..bba6233a 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -1,3 +1,4 @@ +- version = 'v0.3.8' nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse a.navbar-brand IPFS distributions @@ -5,37 +6,27 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse .row .col-md-2 .d-sidebar - ul.nav#d-navbar - li.d-sidebar-item.nav-item.active - a.d-sidebar-link.nav-link go-ipfs + ul.nav#d-navbar: each value, key in public.releases li.d-sidebar-item.nav-item - a.d-sidebar-link.nav-link Station - li.d-sidebar-item.nav-item - a.d-sidebar-link.nav-link ipfs-update - .col-md-10 + a.d-sidebar-link.nav-item(href='##{key}')= key + .col-md-10: each value, key in public.releases .d-component + - data = value[version]._data .d-component-desc.row .col-md-8 h1.d-component-desc-title - | go-ipfs + = data.name h2.d-component-desc-sub-title - | IPFS reference implementation and toolchain in Go + = data.tagline .d-component-desc-body - | go-ipfs is the main implementation of IPFS. It is the base - | distribution, and includes: - ul - li an IPFS core implementation - li an IPFS daemon server - li extensive command line tooling - li an HTTP API for controlling the node - li an HTTP Gateway for serving content to HTTP browsers + != partial('releases/' + key + '/' + version + '/index') .d-component-asset.col-md-4 a(href='https://asciinema.org/a/23012' target='_blank') img(src='https://asciinema.org/a/23012.png' width='260') .d-component-release.row .col-md-4 - h3.d-component-version 0.4.0 + h3.d-component-version= data.version h4.d-component-release-date January 1, 2016 .d-component-actions a.d-component-actions-docs Docs @@ -44,27 +35,9 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse .col-md-8 table.table.d-download-table tbody - tr - th Windows Binary (.zip) - td(colspan='3') 32bit - td(colspan='3') 64bit - tr - th Mac OS X Binary (.zip) - td(colspan='3') 32bit - td(colspan='3') 64bit - tr - th Linux Binary (.tar.gz) - td(colspan='3') 32bit - td(colspan='3') 64bit - tr - th ARM Binary (.tar.gz) - td(colspan='2') ARM v6 - td(colspan='2') ARM v7 - td(colspan='2') ARM v8 - tr - th Free BSD Binary (.tar.gz) - td(colspan='3') 32bit - td(colspan='3') 64bit - tr - th Source Code (.tar.gz) - td(colspan='6') Download + for release in data.releases + tr + th= release.name + - colspan = 6 / release.archs.length + for arch in release.archs + td(colspan="#{colspan}")= arch.name diff --git a/tasks/dist.js b/tasks/dist.js new file mode 100644 index 00000000..b5372660 --- /dev/null +++ b/tasks/dist.js @@ -0,0 +1,24 @@ +const gulp = require('gulp') +const $ = require('gulp-load-plugins')() +const {join} = require('path') + +const mkdist = require('../scripts/mkdist') + +const log = $.util.log + +function fail (msg) { + log($.util.colors.red(msg)) +} + +gulp.task('dist', done => { + const {version, path: dir} = $.util.env + + if (!version) return fail('No --version provided') + if (!dir) return fail('No --path provided') + + log('Building %s with dir %s', version, dir) + + const config = require(join(dir, 'dist.json')) + config.version = version + mkdist(config, done) +}) From f2f7e970331762c0196f9822eb89af01331d2366 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 11 Dec 2015 21:26:08 +0100 Subject: [PATCH 05/36] Add dependencies --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index dd7fd933..42360cfb 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "gulp-watch": "^4.3.5", "harp": "^0.20.0", "jquery": "^2.1.4", + "lodash": "^3.10.1", "mkdirp": "^0.5.1", "pre-commit": "^1.1.2", "require-dir": "^0.3.0", From 84c32f340249d0536ba04516698e685e3eeacc95 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Thu, 17 Dec 2015 23:58:51 +0100 Subject: [PATCH 06/36] Revert some things --- CONTRIBUTING.md | 80 +------------------------------------- Makefile | 11 +++--- README.md | 77 ++++++++++++++++++++++++++++++++++++ dists/go-ipfs/dist.json | 16 +------- dists/go-ipfs/go-ipfs-dist | 4 +- dists/go-ipfs/mkdist.js | 28 +++++++++++++ package.json | 3 +- scripts/gen-index.js | 20 ---------- scripts/mkdist.js | 59 ++++++++++++++-------------- tasks/build.js | 7 +++- 10 files changed, 151 insertions(+), 154 deletions(-) create mode 100644 dists/go-ipfs/mkdist.js delete mode 100755 scripts/gen-index.js diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 936b324b..05d0dc39 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -## Development +## Site Harpjs setup with @@ -15,81 +15,3 @@ Harpjs setup with $ gulp $ open localhost:3000 ``` - - -## How this repo works - -The goal is to generate a file hierarchy that looks like this: - -``` -dist/index.html -- listing of all bundles available -dist/ -- all versions of -dist//README.md -- simple readme for -dist//latest -- points to latest -dist// -- dist version -dist///README.md -- readme for listing -dist///.tar.gz -- archive for -``` - -Definitions: -- `` is a distribution, meaning a program or library we release. -- `` is the version of the `` -- `` is a supported platform of `@` - -So for example, if we had `` `go-ipfs` and `native-app`, we might see a hierarchy like: - -``` -. -├── go-ipfs -│   ├── latest -> v0.3.7 -│   ├── v0.3.6 -│   │   ├── README.md -│   │   ├── go-ipfs_v0.3.6_darwin-386.tar.gz -│   │   ├── go-ipfs_v0.3.6_darwin-amd64.tar.gz -│   │   ├── go-ipfs_v0.3.6_linux-386.tar.gz -│   │   ├── go-ipfs_v0.3.6_linux-amd64.tar.gz -│   │   └── hashes -│   └── v0.3.7 -├── index.html -└── native-app - ├── latest -> v0.2.1 - └── v0.2.1 - ├── README.md -       ├── hashes - ├── ipfs-native-app_v0.2.1_linux.tar.gz - └── ipfs-native-app_v0.2.1_osx.zip - -7 directories, 11 files -``` - -We call this the **distribution index**, the listing of all distributions, their versions, and platform assets. - -Note how they each describe `` differently. This is likely to be inevitable as different platform identifiers will be used by different communities. - -### distribution index versions / updates - -The **distribution index** changes over time, kind of like a git repository. [Since we don't yet have commits](https://github.com/ipfs/notes/issues/23), we will just do a poor-man's versioning for the index itself. We will write all version hashes to a file `versions` in this repository. - -A site like `dist.ipfs.io` or `ipfs.io/dist` would just serve the _latest_ version of the index. - -### How assets are made - -Each `` has a directory in the root of this repo. inside it there is a `Makefile` and other necessary scripts. Running - -``` -make -``` - -Should: -- figure out what the latest released version is (from github tags) -- figure out what versions are missing from the index -- construct the missing `/` directories - -## Do it - -This project uses a makefile + scripts to build all the things. - -``` -make -``` -should do everything. diff --git a/Makefile b/Makefile index 37b8d562..8f4b4a88 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -all: all_dists index +all: all_dists site all_dists: go-ipfs @@ -10,10 +10,9 @@ go-ipfs: echo "** making $@ **" cd dists/$@ && make -index: - echo "** making index.html **" - node gen-index.js >releases/index.html - cp -r static releases/. +site: + echo "** Building site **" + npm run build -publish: all_dists index +publish: all_dists site ipfs add -s rabin -q -r releases | tail -n1 >>versions diff --git a/README.md b/README.md index da74e659..844b7539 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,80 @@ [![Circle CI](https://circleci.com/gh/ipfs/distributions.svg?style=svg)](https://circleci.com/gh/ipfs/distributions) > Source for building https://dist.ipfs.io + +## How this repo works + +The goal is to generate a file hierarchy that looks like this: + +``` +dist/index.html -- listing of all bundles available +dist/ -- all versions of +dist//README.md -- simple readme for +dist//latest -- points to latest +dist// -- dist version +dist///README.md -- readme for listing +dist///.tar.gz -- archive for +``` + +Definitions: +- `` is a distribution, meaning a program or library we release. +- `` is the version of the `` +- `` is a supported platform of `@` + +So for example, if we had `` `go-ipfs` and `native-app`, we might see a hierarchy like: + +``` +. +├── go-ipfs +│   ├── latest -> v0.3.7 +│   ├── v0.3.6 +│   │   ├── README.md +│   │   ├── go-ipfs_v0.3.6_darwin-386.tar.gz +│   │   ├── go-ipfs_v0.3.6_darwin-amd64.tar.gz +│   │   ├── go-ipfs_v0.3.6_linux-386.tar.gz +│   │   ├── go-ipfs_v0.3.6_linux-amd64.tar.gz +│   │   └── hashes +│   └── v0.3.7 +├── index.html +└── native-app + ├── latest -> v0.2.1 + └── v0.2.1 + ├── README.md +       ├── hashes + ├── ipfs-native-app_v0.2.1_linux.tar.gz + └── ipfs-native-app_v0.2.1_osx.zip + +7 directories, 11 files +``` + +We call this the **distribution index**, the listing of all distributions, their versions, and platform assets. + +Note how they each describe `` differently. This is likely to be inevitable as different platform identifiers will be used by different communities. + +### distribution index versions / updates + +The **distribution index** changes over time, kind of like a git repository. [Since we don't yet have commits](https://github.com/ipfs/notes/issues/23), we will just do a poor-man's versioning for the index itself. We will write all version hashes to a file `versions` in this repository. + +A site like `dist.ipfs.io` or `ipfs.io/dist` would just serve the _latest_ version of the index. + +### How assets are made + +Each `` has a directory in the root of this repo. inside it there is a `Makefile` and other necessary scripts. Running + +``` +make +``` + +Should: +- figure out what the latest released version is (from github tags) +- figure out what versions are missing from the index +- construct the missing `/` directories + +## Do it + +This project uses a makefile + scripts to build all the things. + +``` +make +``` +should do everything. diff --git a/dists/go-ipfs/dist.json b/dists/go-ipfs/dist.json index 79645e56..9ddf224c 100644 --- a/dists/go-ipfs/dist.json +++ b/dists/go-ipfs/dist.json @@ -2,19 +2,5 @@ "id": "go-ipfs", "name": "go-ipfs", "tagline": "IPFS implementation and toolchain in Go", - "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n", - "platforms": { - "oses": [ - {"id": "darwin", "name": "Mac OSX App", "browser":"OS X", "icon": "apple"}, - {"id": "linux", "name": "Linux App", "browser":"Linux", "icon": "linux"}, - {"id": "openbsd", "name": "OpenBSD App", "browser":"OpenBSD", "icon": "circle-o"}, - {"id": "freebsd", "name": "FreeBSD App", "browser":"FreeBSD", "icon": "circle-o"}, - {"id": "windows", "name": "Windows App", "browser":"Windows", "icon": "windows"} - ], - "archs": [ - {"id": "386", "name": "32 bit", "browser": "32"}, - {"id": "amd64", "name": "64 bit", "browser": "64"}, - {"id": "arm", "name": "ARM", "browser": "ARM"} - ] - } + "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n" } diff --git a/dists/go-ipfs/go-ipfs-dist b/dists/go-ipfs/go-ipfs-dist index 07b3b816..e8f30619 100755 --- a/dists/go-ipfs/go-ipfs-dist +++ b/dists/go-ipfs/go-ipfs-dist @@ -79,8 +79,8 @@ dist_version() { cd "$cwd" # generate dist.json file - echo "---> generating config for $version" - ../../node_modules/.bin/gulp dist "--path=$(pwd)" "--version=$version" + echo "---> generating dist.json" + `which node` ./mkdist.js "$version" } if [ "$1" = "all" ]; then diff --git a/dists/go-ipfs/mkdist.js b/dists/go-ipfs/mkdist.js new file mode 100644 index 00000000..40a8cfec --- /dev/null +++ b/dists/go-ipfs/mkdist.js @@ -0,0 +1,28 @@ +var mkdist = require('../../scripts/mkdist') + +if (process.argv.length != 3) { + console.log("usage: mkdist.js ") + process.exit(1) +} + +var dist = require('./dist.json') +dist.version = process.argv[2] + +mkdist({ + dist: dist, + path: "../..", + platforms: { + oses: [ + {id: 'darwin', name: "Mac OSX App", browser:'OS X', icon: 'apple'}, + {id: 'linux', name: "Linux App", browser:'Linux', icon: 'linux'}, + {id: 'openbsd', name: "OpenBSD App", browser:'OpenBSD', icon: 'circle-o'}, + {id: 'freebsd', name: "FreeBSD App", browser:'FreeBSD', icon: 'circle-o'}, + {id: 'windows', name: "Windows App", browser:'Windows', icon: 'windows'}, + ], + archs: [ + {id: '386', name: '32 bit', browser: '32'}, + {id: 'amd64', name: '64 bit', browser: '64'}, + {id: 'arm', name: 'ARM', browser: 'ARM'}, + ] + } +}) diff --git a/package.json b/package.json index 42360cfb..ab651ac6 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,8 @@ "webpack-stream": "^2.3.0" }, "scripts": { - "lint": "gulp lint" + "lint": "gulp lint", + "build": "gulp build" }, "repository": { "type": "git", diff --git a/scripts/gen-index.js b/scripts/gen-index.js deleted file mode 100755 index ee4894fa..00000000 --- a/scripts/gen-index.js +++ /dev/null @@ -1,20 +0,0 @@ -var marked = require('marked') -var nunjucks = require('nunjucks') -var njmd = require('nunjucks-markdown') - -var njx = nunjucks.configure('.') -njmd.register(njx, marked) - -var spec = { - template: 'tmpl/index.html', - data: { dists: {} } -} - -var goipfsPath = './releases/go-ipfs/v0.3.7/dist.json' -spec.data.dists['go-ipfs'] = require(goipfsPath) - -njx.render(spec.template, spec.data, function (err, res) { - if (err) throw err - process.stdout.write(res) - process.exit(0) -}) diff --git a/scripts/mkdist.js b/scripts/mkdist.js index 98df27b8..ff13b6d0 100644 --- a/scripts/mkdist.js +++ b/scripts/mkdist.js @@ -1,30 +1,30 @@ -const fs = require('fs') -const {join} = require('path') -const mkdirp = require('mkdirp') - -const sitePath = join(__dirname, '..', 'site', 'public', 'releases') +var fs = require('fs') module.exports = mkdist function mkdist (opts, cb) { if (!opts) throw new Error('no options given') - if (!opts.id) throw new Error('no id given') - if (!opts.version) throw new Error('no version given') + if (!opts.dist) throw new Error('no dist given') + if (!opts.dist.id) throw new Error('no dist.id given') + if (!opts.dist.version) throw new Error('no dist.version given') + if (!opts.path) throw new Error('no path given') if (!opts.platforms) throw new Error('no platforms given') + if (!cb) cb = noopcb - let ver = opts.version + var dist = opts.dist + var ver = dist.version if (ver.match(/^v/)) ver = ver.substring(1) - opts.releaseLink = `releases/${opts.id}/v${ver}` - const releasePath = join(__dirname, '..', opts.releaseLink) - opts.releases = [] + dist.releaseLink = 'releases/' + dist.id + '/v' + ver + var releasePath = opts.path + '/' + dist.releaseLink + dist.platforms = [] - const dir = fs.readdirSync(releasePath) + var dir = fs.readdirSync(releasePath) // add osx installer - const f = findFile(/\.pkg$/) + var f = findFile(/\.pkg$/) if (f) { - opts.releases.push({ + dist.platforms.push({ id: 'osxpkg', name: 'Mac OSX Installer (.pkg)', icon: 'apple', @@ -38,35 +38,31 @@ function mkdist (opts, cb) { // TODO: windows msi installer // add standard os binaries - opts.releases = opts.releases.concat(addOSBinaries(dir, opts.platforms)) + addOSBinaries(dir, opts.platforms, dist.platforms) // add source - opts.releases.push({ + dist.platforms.push({ id: 'src', name: 'Source Code (.zip)', icon: 'archive', archs: [{ name: 'src', - link: opts.id + '_v' + ver + '_src.zip' + link: dist.id + '_v' + ver + '_src.zip' }] }) - writeDist(opts) - cb() + writeDist(releasePath + '/dist.json', dist, function (err) { + if (err) return cb(err) + cb(null, dist) + }) } -function writeDist (dist) { - const targetPath = join(sitePath, dist.id, dist.version) - const targetJson = join(targetPath, '_data.json') - const targetMd = join(targetPath, 'index.md') - - mkdirp.sync(targetPath) - fs.writeFileSync(targetJson, JSON.stringify(dist, null, ' ')) - fs.writeFileSync(targetMd, dist.description) +function writeDist (path, dist) { + fs.writeFileSync(path, JSON.stringify(dist, null, ' ')) + console.log('wrote', path) } -function addOSBinaries (dir, src) { - const dst = [] +function addOSBinaries (dir, src, dst) { for (var osi in src.oses) { var os = src.oses[osi] var p = { @@ -93,7 +89,6 @@ function addOSBinaries (dir, src) { dst.push(p) // do have releases for this os. } } - return dst } @@ -105,3 +100,7 @@ function findFile (dir, pattern) { } return null } + +function noopcb (err) { + if (err) throw err +} diff --git a/tasks/build.js b/tasks/build.js index 7a044ab7..9bd97140 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -1 +1,6 @@ -// TODO: Build harp + webpack +const gulp = require('gulp') +const $ = require('gulp-load-plugins')() + +gulp.task('build', () => { + $.util.log('Not implemented!') +}) From 55b18443585489ae2e2253850a621f815ad1add6 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 18 Dec 2015 15:34:01 +0100 Subject: [PATCH 07/36] Handle copying of dist files and update site --- dists/go-ipfs/dist.json | 3 ++- package.json | 1 + site/public/index.jade | 10 ++++----- tasks/dist.js | 50 ++++++++++++++++++++++++++++++++--------- tasks/serve.js | 2 +- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/dists/go-ipfs/dist.json b/dists/go-ipfs/dist.json index 9ddf224c..3dae2884 100644 --- a/dists/go-ipfs/dist.json +++ b/dists/go-ipfs/dist.json @@ -2,5 +2,6 @@ "id": "go-ipfs", "name": "go-ipfs", "tagline": "IPFS implementation and toolchain in Go", - "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n" + "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n", + "ascii": "ev9so7mlfqme0254s50oqiw1l" } diff --git a/package.json b/package.json index ab651ac6..93e32d8f 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "gulpfile.babel.js", "dependencies": {}, "devDependencies": { + "async": "^1.5.0", "babel-core": "^6.1.2", "babel-eslint": "^4.1.3", "babel-jscs": "^2.0.0", diff --git a/site/public/index.jade b/site/public/index.jade index bba6233a..2e3ae91c 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -11,7 +11,7 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse a.d-sidebar-link.nav-item(href='##{key}')= key .col-md-10: each value, key in public.releases .d-component - - data = value[version]._data + - data = value._data .d-component-desc.row .col-md-8 h1.d-component-desc-title @@ -19,10 +19,10 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse h2.d-component-desc-sub-title = data.tagline .d-component-desc-body - != partial('releases/' + key + '/' + version + '/index') + != partial('releases/' + key + '/index') .d-component-asset.col-md-4 - a(href='https://asciinema.org/a/23012' target='_blank') - img(src='https://asciinema.org/a/23012.png' width='260') + a(href="https://asciinema.org/a/#{data.ascii}" target='_blank') + img(src="https://asciinema.org/a/#{data.ascii}.png" width='260') .d-component-release.row .col-md-4 @@ -35,7 +35,7 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse .col-md-8 table.table.d-download-table tbody - for release in data.releases + for release in data.platforms tr th= release.name - colspan = 6 / release.archs.length diff --git a/tasks/dist.js b/tasks/dist.js index b5372660..ca6831f0 100644 --- a/tasks/dist.js +++ b/tasks/dist.js @@ -1,24 +1,54 @@ const gulp = require('gulp') const $ = require('gulp-load-plugins')() +const fs = require('fs') const {join} = require('path') - -const mkdist = require('../scripts/mkdist') +const _ = require('lodash') +const mkdirp = require('mkdirp') +const async = require('async') const log = $.util.log function fail (msg) { log($.util.colors.red(msg)) + process.exit(1) } -gulp.task('dist', done => { - const {version, path: dir} = $.util.env +const RELEASE_PATH = join(__dirname, '..', 'releases') +const SITE_PATH = join(__dirname, '..', 'site', 'public', 'releases') + +function getVersion (type, done) { + const p = join(RELEASE_PATH, type, 'versions') - if (!version) return fail('No --version provided') - if (!dir) return fail('No --path provided') + fs.readFile(p, (err, versions) => { + if (err) return done(err) + done(null, _(versions.toString().split('\n')).compact().last()) + }) +} + +function writeData (type, version, done) { + const dataPath = join(RELEASE_PATH, type, version, 'dist.json') + const data = JSON.parse(fs.readFileSync(dataPath).toString()) - log('Building %s with dir %s', version, dir) + const dataTargetPath = join(SITE_PATH, type) + async.series([ + mkdirp.bind(mkdirp, dataTargetPath), + fs.writeFile.bind(fs, join(dataTargetPath, '_data.json'), JSON.stringify(data, null, 2)), + fs.writeFile.bind(fs, join(dataTargetPath, 'index.md'), data.description) + ], done) +} + +function writeSiteFiles (type, done) { + getVersion(type, (err, version) => { + if (err) return done(err) + + writeData(type, version, done) + }) +} + +gulp.task('dist', done => { + fs.readdir(RELEASE_PATH, (err, types) => { + if (err) return fail(err.msg) - const config = require(join(dir, 'dist.json')) - config.version = version - mkdist(config, done) + async.each(types, writeSiteFiles, done) + }) }) diff --git a/tasks/serve.js b/tasks/serve.js index 55f12ed6..b34f6d2b 100644 --- a/tasks/serve.js +++ b/tasks/serve.js @@ -97,4 +97,4 @@ gulp.task('webpack', () => { .pipe(gulp.dest('site/')) }) -gulp.task('serve', ['harp', 'webpack']) +gulp.task('serve', ['dist', 'harp', 'webpack']) From 2ddcdc978d6610a46b19d475753ce2eeb85d48fe Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 18 Dec 2015 15:45:30 +0100 Subject: [PATCH 08/36] Links and dist.json cleanup for go-ipfs --- dists/go-ipfs/mkdist.js | 16 ++++++++-------- site/public/index.jade | 11 ++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/dists/go-ipfs/mkdist.js b/dists/go-ipfs/mkdist.js index 40a8cfec..abb69999 100644 --- a/dists/go-ipfs/mkdist.js +++ b/dists/go-ipfs/mkdist.js @@ -1,7 +1,7 @@ var mkdist = require('../../scripts/mkdist') if (process.argv.length != 3) { - console.log("usage: mkdist.js ") + console.log('usage: mkdist.js ') process.exit(1) } @@ -10,19 +10,19 @@ dist.version = process.argv[2] mkdist({ dist: dist, - path: "../..", + path: '../..', platforms: { oses: [ - {id: 'darwin', name: "Mac OSX App", browser:'OS X', icon: 'apple'}, - {id: 'linux', name: "Linux App", browser:'Linux', icon: 'linux'}, - {id: 'openbsd', name: "OpenBSD App", browser:'OpenBSD', icon: 'circle-o'}, - {id: 'freebsd', name: "FreeBSD App", browser:'FreeBSD', icon: 'circle-o'}, - {id: 'windows', name: "Windows App", browser:'Windows', icon: 'windows'}, + {id: 'darwin', name: 'Mac OSX Binary (.zip)', browser: 'OS X'}, + {id: 'linux', name: 'Linux Binary (.zip)', browser: 'Linux'}, + {id: 'openbsd', name: 'OpenBSD Binary (.zip)', browser: 'OpenBSD'}, + {id: 'freebsd', name: 'FreeBSD Binary (.zip)', browser: 'FreeBSD'}, + {id: 'windows', name: 'Windows Binary (.zip)', browser: 'Windows'} ], archs: [ {id: '386', name: '32 bit', browser: '32'}, {id: 'amd64', name: '64 bit', browser: '64'}, - {id: 'arm', name: 'ARM', browser: 'ARM'}, + {id: 'arm', name: 'ARM', browser: 'ARM'} ] } }) diff --git a/site/public/index.jade b/site/public/index.jade index 2e3ae91c..116a1f96 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -35,9 +35,10 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse .col-md-8 table.table.d-download-table tbody - for release in data.platforms + for p in data.platforms + - colspan = 6 / p.archs.length tr - th= release.name - - colspan = 6 / release.archs.length - for arch in release.archs - td(colspan="#{colspan}")= arch.name + th= p.name + for arch in p.archs + td(colspan="#{colspan}") + a(href="#{data.releaseLink}/#{arch.link}")= arch.name From 72acba8156b0483b791df90990906d55d49163f7 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Fri, 18 Dec 2015 16:07:25 +0100 Subject: [PATCH 09/36] Add preleminary links for docs, changelog and all versions --- site/public/index.jade | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/site/public/index.jade b/site/public/index.jade index 116a1f96..217d7805 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -29,9 +29,12 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse h3.d-component-version= data.version h4.d-component-release-date January 1, 2016 .d-component-actions - a.d-component-actions-docs Docs - a.d-component-actions-changelog Changelog - a.d-component-actions-versions All Versions + a.d-component-actions-docs(href="https://github.com/ipfs/#{data.id}/tree/#{data.version}/README.md" target='_blank') + | Docs + a.d-component-actions-changelog(href="https://github.com/ipfs/#{data.id}/tree/#{data.version}/CHANGELOG.md" target='_blank') + | Changelog + a.d-component-actions-versions(href="#{data.id}") + | All Versions .col-md-8 table.table.d-download-table tbody From c356c465fede858ba06fff244fe4b743dfc3241c Mon Sep 17 00:00:00 2001 From: Jeromy Date: Wed, 9 Dec 2015 13:57:21 -0800 Subject: [PATCH 10/36] build the binaries on our own --- dists/go-ipfs/.gitignore | 1 + dists/go-ipfs/Makefile | 23 +---- dists/go-ipfs/build-versions.sh | 139 ++++++++++++++++++++++++++++++ dists/go-ipfs/go-ipfs-dist | 94 -------------------- dists/go-ipfs/matrices/v0.3.10 | 10 +++ dists/go-ipfs/matrices/v0.3.2 | 10 +++ dists/go-ipfs/matrices/v0.3.3 | 10 +++ dists/go-ipfs/matrices/v0.3.4 | 10 +++ dists/go-ipfs/matrices/v0.3.5 | 10 +++ dists/go-ipfs/matrices/v0.3.6 | 10 +++ dists/go-ipfs/matrices/v0.3.7 | 10 +++ dists/go-ipfs/matrices/v0.3.8 | 10 +++ dists/go-ipfs/matrices/v0.3.9 | 10 +++ dists/go-ipfs/matrices/v0.4.0-dev | 10 +++ dists/go-ipfs/versions | 3 + 15 files changed, 245 insertions(+), 115 deletions(-) create mode 100644 dists/go-ipfs/.gitignore create mode 100755 dists/go-ipfs/build-versions.sh delete mode 100755 dists/go-ipfs/go-ipfs-dist create mode 100644 dists/go-ipfs/matrices/v0.3.10 create mode 100644 dists/go-ipfs/matrices/v0.3.2 create mode 100644 dists/go-ipfs/matrices/v0.3.3 create mode 100644 dists/go-ipfs/matrices/v0.3.4 create mode 100644 dists/go-ipfs/matrices/v0.3.5 create mode 100644 dists/go-ipfs/matrices/v0.3.6 create mode 100644 dists/go-ipfs/matrices/v0.3.7 create mode 100644 dists/go-ipfs/matrices/v0.3.8 create mode 100644 dists/go-ipfs/matrices/v0.3.9 create mode 100644 dists/go-ipfs/matrices/v0.4.0-dev diff --git a/dists/go-ipfs/.gitignore b/dists/go-ipfs/.gitignore new file mode 100644 index 00000000..9dcf6e6f --- /dev/null +++ b/dists/go-ipfs/.gitignore @@ -0,0 +1 @@ +gopath/* diff --git a/dists/go-ipfs/Makefile b/dists/go-ipfs/Makefile index 1681b0fb..226409d9 100644 --- a/dists/go-ipfs/Makefile +++ b/dists/go-ipfs/Makefile @@ -1,32 +1,13 @@ repo = http://github.com/ipfs/go-ipfs -gpath = github.com/ipfs/go-ipfs/cmd/ipfs releases = ../../releases/go-ipfs -gbcli = $(shell which gobuilder-cli) all: dist -dist: versions deps +dist: versions mkdir -p $(releases) cp versions $(releases)/versions - ./go-ipfs-dist all + ./build-versions.sh versions: filtered_versions git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions cat tag_versions | grep -f filtered_versions -vE > versions - -deps: bin bin/gobuilder-cli go-ipfs-dist-x - -bin: - @mkdir -p bin - -go-ipfs-dist-x: - chmod +x go-ipfs-dist - -bin/gobuilder-cli: bin - #TODO: make this not require a go compiler... - go get github.com/Luzifer/gobuilder/cmd/gobuilder-cli - cp $(gbcli) bin/gobuilder-cli - -# bin/go-env: -# ipfs get -o bin/go-env QmfS4PZj7G7KgAztPN3JxXyY6KHJDZ77EaxzocWqsa3XhQ/go-env -# chmox +x bin/go-env diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh new file mode 100755 index 00000000..1a3c47db --- /dev/null +++ b/dists/go-ipfs/build-versions.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +# globals +outputDir=../../releases/go-ipfs +goipfspath=github.com/ipfs/go-ipfs/cmd/ipfs + +txtnon='\e[0m' # color reset +txtblk='\e[0;30m' # Black +txtred='\e[0;31m' # Red +txtgrn='\e[0;32m' # Green +txtylw='\e[0;33m' # Yellow +txtblu='\e[0;34m' # Blue + +function fail() { + echo -e $txtred$@$txtnon + exit 1 +} + +function warn() { + echo -e $txtylw$@$txtnon +} + +function notice() { + echo -e $txtgrn$@$txtnon +} + +function doBuild() { + local goos=$1 + local goarch=$2 + local target=$3 + local output=$4 + + echo "==> building for $goos $goarch" + + dir=$output/$1-$2 + if [ -e $dir ] + then + echo " $dir exists, skipping build" + return + fi + echo " output to $dir" + mkdir -p $dir + + (cd $dir && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) + local success=$? + if [ "$success" == 0 ] + then + notice " success!" + else + warn " failed." + fi + + # output results to results table + echo $target, $goos, $goarch, $? >> $output/results +} + +function buildWithMatrix() { + local matfile=$1 + local gobin=$2 + local output=$3 + local commit=$4 + + if [ -z "$output" ] + then + fail "error: output dir not specified" + fi + + if [ ! -e $matfile ] + then + fail "build matrix $matfile does not exist" + fi + + # print out build information + mkdir -p $output + go version > $output/build-info + echo "git sha of code: $commit" >> $output/build-info + uname -a >> $output/build-info + echo built on `date` >> $output/build-info + + # build each os/arch combo + while read line + do + doBuild $line $gobin $output + done < $matfile +} + +function checkoutVersion() { + local repopath=$1 + local ref=$2 + + echo "==> checking out version $ref in $repopath" + (cd $repopath && git checkout $ref > /dev/null) + + if [ "$?" != 0 ] + then + fail "failed to check out $ref in $repopath" + fi +} + +function currentSha() { + (cd $1 && git show --pretty="%H") +} + +# if the output directory already exists, warn user +if [ -e $outputDir ] +then + warn "dirty output directory" + warn "will skip building already existing binaries" +fi + + +export GOPATH=$(pwd)/gopath +if [ ! -e $GOPATH ] +then + echo "fetching ipfs code..." + go get $goipfspath 2> /dev/null +fi + +repopath=$GOPATH/src/$goipfspath + +versarr="" +while read v +do + versarr="$versarr $v" +done < versions + +echo "building versions: $versarr" + +echo "" +while read v +do + notice "Building version $v binaries" + checkoutVersion $repopath $v + + buildWithMatrix matrices/$v $goipfspath $outputDir/$v $(currentSha $repopath) + echo "" +done < versions + +notice "build complete!" diff --git a/dists/go-ipfs/go-ipfs-dist b/dists/go-ipfs/go-ipfs-dist deleted file mode 100755 index e8f30619..00000000 --- a/dists/go-ipfs/go-ipfs-dist +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash - -# constants -repo="github.com/ipfs/go-ipfs" -gpath="github.com/ipfs/go-ipfs/cmd/ipfs" -releases="../../releases/go-ipfs" - -if [ "$#" -eq 0 ]; then - echo "usage: $0 " - echo "construct the go-ipfs dist directory for given version" - echo "" - exit 1 -fi - -die() { - echo >&2 "error: $@" - exit 1 -} - -assert() { - eval $1 >/dev/null 2>&1 || die $2 -} - -# check we have things installed -assert "bin/gobuilder-cli -h" "please run: make deps" -assert "ipfs -h" "please install ipfs" -assert "stat versions" "please run: make versions" - -# check the ipfs daemon is running -ipfs swarm peers >/dev/null || die "please run: ipfs daemon" - - -dist_version() { - # get version from input - cwd=`pwd` - version=$1 - dest_path="$releases/$version" - dest_path_src="$dest_path/go-ipfs_${version}_src.zip" - - # check version is ok - cat versions | grep "$version" >/dev/null || die "versions not in listing" - - stat "$releases/$version/dist.json" >/dev/null 2>&1 - if [ "$?" -eq 0 ]; then - echo "--> have $version in $dest_path" - return - fi - - echo "--> making $version" - - # get archives from gobuilder - echo "---> preparing $dest_path" - mkdir -p "$dest_path" - - echo "---> getting archives from gobuilder..." - bin/gobuilder-cli get-all "$gpath" "$dest_path" "$version" - if [ "$?" -ne 0 ]; then - echo "---> failed." - return -1 - fi - - # move gobuilder archives; they start with "ipfs_", not "go-ipfs_" - cd "$dest_path" - for f in ipfs_*.zip ; do mv "$f" "go-$f"; done - echo "mmv ipfs_*.zip go-ipfs_*.zip" - cd "$cwd" - - # get OSX installer (TODO) - # echo "---> building OSX installer..." - - echo "---> getting source tarball" - wget -q -O "$dest_path_src" "https://$repo/zipball/$version.zip" - echo "wrote $dest_path_src" - - # generate hashes file - echo "---> generating hashes" - cd "$dest_path" - ipfs add -s rabin --only-hash * >hashes - cd "$cwd" - - # generate dist.json file - echo "---> generating dist.json" - `which node` ./mkdist.js "$version" -} - -if [ "$1" = "all" ]; then - - for version in $(cat versions); do - dist_version $version || die "failed to make $version" - done - -else - dist_version $1 || die "failed to make $version" -fi diff --git a/dists/go-ipfs/matrices/v0.3.10 b/dists/go-ipfs/matrices/v0.3.10 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.10 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.2 b/dists/go-ipfs/matrices/v0.3.2 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.2 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.3 b/dists/go-ipfs/matrices/v0.3.3 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.3 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.4 b/dists/go-ipfs/matrices/v0.3.4 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.4 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.5 b/dists/go-ipfs/matrices/v0.3.5 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.5 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.6 b/dists/go-ipfs/matrices/v0.3.6 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.6 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.7 b/dists/go-ipfs/matrices/v0.3.7 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.7 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.8 b/dists/go-ipfs/matrices/v0.3.8 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.8 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.3.9 b/dists/go-ipfs/matrices/v0.3.9 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.3.9 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/matrices/v0.4.0-dev b/dists/go-ipfs/matrices/v0.4.0-dev new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/go-ipfs/matrices/v0.4.0-dev @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/go-ipfs/versions b/dists/go-ipfs/versions index bb48fbaf..211ba11f 100644 --- a/dists/go-ipfs/versions +++ b/dists/go-ipfs/versions @@ -4,3 +4,6 @@ v0.3.5 v0.3.6 v0.3.7 v0.3.8 +v0.3.9 +v0.3.10 +v0.4.0-dev From 4052254e333c905be68d600c4101b40ff621cdaa Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 19 Dec 2015 14:05:52 -0800 Subject: [PATCH 11/36] better color printing maybe --- dists/go-ipfs/build-versions.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index 1a3c47db..8312008c 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -4,24 +4,23 @@ outputDir=../../releases/go-ipfs goipfspath=github.com/ipfs/go-ipfs/cmd/ipfs +# init colors txtnon='\e[0m' # color reset -txtblk='\e[0;30m' # Black txtred='\e[0;31m' # Red txtgrn='\e[0;32m' # Green txtylw='\e[0;33m' # Yellow -txtblu='\e[0;34m' # Blue function fail() { - echo -e $txtred$@$txtnon + printf $txtred%s$txtnon\\n "$@" exit 1 } function warn() { - echo -e $txtylw$@$txtnon + printf $txtylw%s$txtnon\\n "$@" } function notice() { - echo -e $txtgrn$@$txtnon + printf $txtgrn%s$txtnon\\n "$@" } function doBuild() { From f599fdfda2f91d4d1002622b0d09a795335f3b75 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 19 Dec 2015 23:51:26 -0800 Subject: [PATCH 12/36] generate dist.json files --- dists/go-ipfs/build-versions.sh | 135 +++++++++++++++++++++++--------- dists/go-ipfs/description | 1 + dists/go-ipfs/dist.json | 7 -- 3 files changed, 97 insertions(+), 46 deletions(-) create mode 100644 dists/go-ipfs/description delete mode 100644 dists/go-ipfs/dist.json diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index 8312008c..afab5640 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -1,8 +1,7 @@ #!/bin/bash # globals -outputDir=../../releases/go-ipfs -goipfspath=github.com/ipfs/go-ipfs/cmd/ipfs +releases=../../releases # init colors txtnon='\e[0m' # color reset @@ -23,6 +22,32 @@ function notice() { printf $txtgrn%s$txtnon\\n "$@" } +# dep checks +if [ ! -f `which jq` ] +then + fail "must have 'jq' installed" +fi + +function printDistInfo() { + # print json output + jq -e ".platforms[\"$goos\"]" dist.json > /dev/null + if [ ! $? -eq 0 ] + then + cp dist.json dist.json.temp + jq ".platforms[\"$goos\"] = {\"name\":\"$goos Binary\",\"archs\":{}}" dist.json.temp > dist.json + fi + + local binname="ipfs" + if [ "$goos" = "windows" ] + then + binname="ipfs.exe" + fi + + cp dist.json dist.json.temp + jq ".platforms[\"$goos\"].archs[\"$goarch\"] = {\"link\":\"$goos-$goarch/$binname\"}" dist.json.temp > dist.json + +} + function doBuild() { local goos=$1 local goarch=$2 @@ -45,12 +70,31 @@ function doBuild() { if [ "$success" == 0 ] then notice " success!" + printDistInfo else warn " failed." fi # output results to results table - echo $target, $goos, $goarch, $? >> $output/results + echo $target, $goos, $goarch, $success >> $output/results +} + +function printInitialDistfile() { + local distname=$1 + local version=$2 + printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"releases/$distname/$version\"}" | + jq ".name = \"go-ipfs\"" | + jq ".platforms = {}" | + jq ".description = \"`cat description`\"" +} + +function printBuildInfo() { + # print out build information + local commit=$1 + go version + echo "git sha of code: $commit" + uname -a + echo built on `date` } function buildWithMatrix() { @@ -59,28 +103,26 @@ function buildWithMatrix() { local output=$3 local commit=$4 - if [ -z "$output" ] - then + if [ -z "$output" ]; then fail "error: output dir not specified" fi - if [ ! -e $matfile ] - then + if [ ! -e $matfile ]; then fail "build matrix $matfile does not exist" fi - # print out build information mkdir -p $output - go version > $output/build-info - echo "git sha of code: $commit" >> $output/build-info - uname -a >> $output/build-info - echo built on `date` >> $output/build-info + + printInitialDistfile "go-ipfs" $version > dist.json + printBuildInfo $commit > $output/build-info # build each os/arch combo while read line do doBuild $line $gobin $output done < $matfile + + mv dist.json $output/dist.json } function checkoutVersion() { @@ -100,39 +142,54 @@ function currentSha() { (cd $1 && git show --pretty="%H") } -# if the output directory already exists, warn user -if [ -e $outputDir ] -then - warn "dirty output directory" - warn "will skip building already existing binaries" -fi +function printVersions() { + versarr="" + while read v + do + versarr="$versarr $v" + done < versions + echo "building versions: $versarr" +} +function startGoBuilds() { + distname=$1 + gpath=$2 -export GOPATH=$(pwd)/gopath -if [ ! -e $GOPATH ] -then - echo "fetching ipfs code..." - go get $goipfspath 2> /dev/null -fi + outputDir=$releases/$distname -repopath=$GOPATH/src/$goipfspath + # if the output directory already exists, warn user + if [ -e $outputDir ] + then + warn "dirty output directory" + warn "will skip building already existing binaries" + fi -versarr="" -while read v -do - versarr="$versarr $v" -done < versions + export GOPATH=$(pwd)/gopath + if [ ! -e $GOPATH ] + then + echo "fetching ipfs code..." + go get $gpath 2> /dev/null + fi -echo "building versions: $versarr" + repopath=$GOPATH/src/$gpath -echo "" -while read v -do - notice "Building version $v binaries" - checkoutVersion $repopath $v + printVersions - buildWithMatrix matrices/$v $goipfspath $outputDir/$v $(currentSha $repopath) echo "" -done < versions + while read version + do + notice "Building version $version binaries" + checkoutVersion $repopath $version + + buildWithMatrix matrices/$version $gpath $outputDir/$version $(currentSha $repopath) + echo "" + done < versions + + notice "build complete!" +} +# globals + + +gpath=github.com/ipfs/go-ipfs/cmd/ipfs -notice "build complete!" +startGoBuilds go-ipfs $gpath diff --git a/dists/go-ipfs/description b/dists/go-ipfs/description new file mode 100644 index 00000000..6452bb88 --- /dev/null +++ b/dists/go-ipfs/description @@ -0,0 +1 @@ +go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n diff --git a/dists/go-ipfs/dist.json b/dists/go-ipfs/dist.json deleted file mode 100644 index 3dae2884..00000000 --- a/dists/go-ipfs/dist.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "id": "go-ipfs", - "name": "go-ipfs", - "tagline": "IPFS implementation and toolchain in Go", - "description": "go-ipfs is the main implementation of IPFS. It is the base distribution, and includes:\n- an IPFS core implementation\n- an IPFS daemon server\n- extensive command line tooling\n- an HTTP API for controlling the node\n- an HTTP Gateway for serving content to HTTP browsers\n", - "ascii": "ev9so7mlfqme0254s50oqiw1l" -} From f6e13581df4dd775b29132c2ce2e311e0129a585 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 5 Jan 2016 23:32:41 +0100 Subject: [PATCH 13/36] chore: Upgrade dependencies --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 93e32d8f..15155037 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "devDependencies": { "async": "^1.5.0", "babel-core": "^6.1.2", - "babel-eslint": "^4.1.3", - "babel-jscs": "^2.0.0", + "babel-eslint": "^5.0.0-beta6", + "babel-jscs": "^3.0.0-beta1", "babel-loader": "^6.0.0", "babel-plugin-transform-remove-console": "^6.0.14", "babel-polyfill": "^6.0.14", @@ -32,7 +32,7 @@ "require-dir": "^0.3.0", "tether": "^1.1.1", "webpack": "^1.12.2", - "webpack-stream": "^2.3.0" + "webpack-stream": "^3.1.0" }, "scripts": { "lint": "gulp lint", From 196688e8c2addebfc35fcd09bd5b8f1af39d52d0 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Wed, 6 Jan 2016 00:04:13 +0100 Subject: [PATCH 14/36] feat: Implement gulp build --- .gitignore | 1 + package.json | 2 + CONTRIBUTING.md => site/README.md | 12 ++++- site/public/_harp.json | 6 +++ site/public/_js/script.js | 9 +--- site/public/css/{base.less => _base.less} | 0 .../css/{component.less => _component.less} | 0 .../css/{sidebar.less => _sidebar.less} | 0 .../css/{colors.less => _variables.less} | 0 site/public/css/style.less | 8 ++-- tasks/build.js | 30 ++++++++++-- tasks/config.js | 48 +++++++++++++++++++ tasks/serve.js | 33 ++----------- 13 files changed, 102 insertions(+), 47 deletions(-) rename CONTRIBUTING.md => site/README.md (57%) create mode 100644 site/public/_harp.json rename site/public/css/{base.less => _base.less} (100%) rename site/public/css/{component.less => _component.less} (100%) rename site/public/css/{sidebar.less => _sidebar.less} (100%) rename site/public/css/{colors.less => _variables.less} (100%) create mode 100644 tasks/config.js diff --git a/.gitignore b/.gitignore index 695253f6..ce5a4c47 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ logs **/node_modules releases dists/ipfs-app/build +www \ No newline at end of file diff --git a/package.json b/package.json index 15155037..56b9f4c3 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "babel-preset-es2015": "^6.3.13", "bootstrap": "^4.0.0-alpha.2", "browser-sync": "^2.10.0", + "del": "^2.2.0", "eslint": "^1.8.0", "eslint-config-standard": "^4.4.0", "eslint-plugin-standard": "^1.3.1", @@ -30,6 +31,7 @@ "mkdirp": "^0.5.1", "pre-commit": "^1.1.2", "require-dir": "^0.3.0", + "run-sequence": "^1.1.5", "tether": "^1.1.1", "webpack": "^1.12.2", "webpack-stream": "^3.1.0" diff --git a/CONTRIBUTING.md b/site/README.md similarity index 57% rename from CONTRIBUTING.md rename to site/README.md index 05d0dc39..7161d9bd 100644 --- a/CONTRIBUTING.md +++ b/site/README.md @@ -1,6 +1,6 @@ -# Contributing +# Site -## Site +> Distributions page written with [harpjs](http://harpjs.com). Harpjs setup with @@ -9,9 +9,17 @@ Harpjs setup with * bundeling using webpack * transpiling using babel * Linting using eslint +* Templates in jade +## Development ```bash $ gulp $ open localhost:3000 ``` + +## Build + +```bash +$ gulp build +``` diff --git a/site/public/_harp.json b/site/public/_harp.json new file mode 100644 index 00000000..dd5c8f53 --- /dev/null +++ b/site/public/_harp.json @@ -0,0 +1,6 @@ +{ + "globals": { + "title": "IPFS Distributions", + "desc": "Easily download everything needed for your IPFS needs" + } +} diff --git a/site/public/_js/script.js b/site/public/_js/script.js index 77df8f9c..577bbe67 100644 --- a/site/public/_js/script.js +++ b/site/public/_js/script.js @@ -1,10 +1,3 @@ -const $ = window.jQuery = require('jquery') +window.jQuery = require('jquery') window.Tether = require('tether') require('bootstrap') - -const init = () => { - // LETS DO THIS! - console.log('hello world') -} - -$(init) diff --git a/site/public/css/base.less b/site/public/css/_base.less similarity index 100% rename from site/public/css/base.less rename to site/public/css/_base.less diff --git a/site/public/css/component.less b/site/public/css/_component.less similarity index 100% rename from site/public/css/component.less rename to site/public/css/_component.less diff --git a/site/public/css/sidebar.less b/site/public/css/_sidebar.less similarity index 100% rename from site/public/css/sidebar.less rename to site/public/css/_sidebar.less diff --git a/site/public/css/colors.less b/site/public/css/_variables.less similarity index 100% rename from site/public/css/colors.less rename to site/public/css/_variables.less diff --git a/site/public/css/style.less b/site/public/css/style.less index 98b25713..4071e2da 100644 --- a/site/public/css/style.less +++ b/site/public/css/style.less @@ -1,7 +1,7 @@ @import (inline) '../../../node_modules/bootstrap/dist/css/bootstrap.css'; -@import './colors'; -@import './base'; +@import './_variables'; +@import './_base'; -@import './sidebar'; -@import './component'; +@import './_sidebar'; +@import './_component'; diff --git a/tasks/build.js b/tasks/build.js index 9bd97140..40e2d0e3 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -1,6 +1,30 @@ const gulp = require('gulp') -const $ = require('gulp-load-plugins')() +const runSequence = require('run-sequence') +const harp = require('harp') +const webpackStream = require('webpack-stream') +const del = require('del') -gulp.task('build', () => { - $.util.log('Not implemented!') +const config = require('./config') + +gulp.task('clean', () => { + return del(['./www']) +}) + +gulp.task('webpack:prod', () => { + return gulp.src('./site/public/_js/script.js') + .pipe(webpackStream(config.webpack.prod)) + .pipe(gulp.dest('site/')) +}) + +gulp.task('harp:compile', done => { + harp.compile('./site', '../www', done) +}) + +gulp.task('build', done => { + runSequence( + ['clean', 'dist'], + 'webpack:prod', + 'harp:compile', + done + ) }) diff --git a/tasks/config.js b/tasks/config.js new file mode 100644 index 00000000..9a3f1d6e --- /dev/null +++ b/tasks/config.js @@ -0,0 +1,48 @@ +const webpack = require('webpack') + +const base = { + entry: [ + 'babel-polyfill', + './site/public/_js/script.js' + ], + output: { + path: __dirname, + filename: './public/build/script.js' + }, + module: { + loaders: [{ + test: /\.js$/, + exclude: /node_modules/, + loader: 'babel', + query: { + cacheDirectory: true, + presets: ['es2015'] + } + }] + }, + plugins: [ + new webpack.NoErrorsPlugin() + ], + stats: { + colors: true + } +} + +module.exports = { + webpack: { + dev: Object.assign({}, base, { + watch: true, + devtool: 'source-map' + }), + prod: Object.assign({}, base, { + plugins: [ + new webpack.optimize.UglifyJsPlugin({ + compressor: { + warnings: false + } + }), + new webpack.NoErrorsPlugin() + ] + }) + } +} diff --git a/tasks/serve.js b/tasks/serve.js index b34f6d2b..04a166a1 100644 --- a/tasks/serve.js +++ b/tasks/serve.js @@ -2,11 +2,12 @@ const gulp = require('gulp') const browserSync = require('browser-sync') const reload = browserSync.reload const harp = require('harp') -const webpack = require('webpack') const webpackStream = require('webpack-stream') const $ = require('gulp-load-plugins')() const _ = require('lodash') +const config = require('./config') + const tmpFiles = p => { const file = _.last(p.split('/')) const emacsTmp = !!file.match(/^\.#/) @@ -65,35 +66,7 @@ gulp.task('harp', () => { gulp.task('webpack', () => { gulp.src('./site/public/_js/script.js') - .pipe(webpackStream({ - watch: true, - entry: [ - 'babel-polyfill', - './site/public/_js/script.js' - ], - output: { - path: __dirname, - filename: './public/build/script.js' - }, - module: { - loaders: [{ - test: /\.js$/, - exclude: /node_modules/, - loader: 'babel', - query: { - cacheDirectory: true, - presets: ['es2015'] - } - }] - }, - plugins: [ - new webpack.NoErrorsPlugin() - ], - stats: { - colors: true - }, - devtool: 'source-map' - })) + .pipe(webpackStream(config.webpack.dev)) .pipe(gulp.dest('site/')) }) From 836d6c3780cc6106819a692219b65a5ae26225bd Mon Sep 17 00:00:00 2001 From: Jeromy Johnson Date: Wed, 6 Jan 2016 17:20:57 +0100 Subject: [PATCH 15/36] a bit more generalized --- dists/go-ipfs/build-versions.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index afab5640..0f0a4799 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -37,10 +37,10 @@ function printDistInfo() { jq ".platforms[\"$goos\"] = {\"name\":\"$goos Binary\",\"archs\":{}}" dist.json.temp > dist.json fi - local binname="ipfs" + local binname="$1" if [ "$goos" = "windows" ] then - binname="ipfs.exe" + binname="$binname.exe" fi cp dist.json dist.json.temp @@ -67,10 +67,11 @@ function doBuild() { (cd $dir && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) local success=$? + local binname=$(basename $target) if [ "$success" == 0 ] then notice " success!" - printDistInfo + printDistInfo $binname else warn " failed." fi @@ -83,7 +84,7 @@ function printInitialDistfile() { local distname=$1 local version=$2 printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"releases/$distname/$version\"}" | - jq ".name = \"go-ipfs\"" | + jq ".name = \"$disname\"" | jq ".platforms = {}" | jq ".description = \"`cat description`\"" } @@ -113,7 +114,9 @@ function buildWithMatrix() { mkdir -p $output - printInitialDistfile "go-ipfs" $version > dist.json + local distname=$(basename $gobin) + + printInitialDistfile $distname $version > dist.json printBuildInfo $commit > $output/build-info # build each os/arch combo @@ -167,7 +170,7 @@ function startGoBuilds() { export GOPATH=$(pwd)/gopath if [ ! -e $GOPATH ] then - echo "fetching ipfs code..." + echo "fetching $distname code..." go get $gpath 2> /dev/null fi From 3bdd8f069388264ea8e87410788987d68975efc7 Mon Sep 17 00:00:00 2001 From: Jeromy Johnson Date: Wed, 6 Jan 2016 19:42:35 +0100 Subject: [PATCH 16/36] working towards zipping --- dists/go-ipfs/build-versions.sh | 34 ++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index 0f0a4799..43fb6951 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -23,10 +23,14 @@ function notice() { } # dep checks -if [ ! -f `which jq` ] -then - fail "must have 'jq' installed" -fi +reqbins="jq zip go" +for b in $reqbins +do + if ! type $b > /dev/null + then + fail "must have '$b' installed" + fi +done function printDistInfo() { # print json output @@ -65,17 +69,29 @@ function doBuild() { echo " output to $dir" mkdir -p $dir - (cd $dir && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) + mkdir -p tmp-build + + (cd tmp-build && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) local success=$? local binname=$(basename $target) if [ "$success" == 0 ] then - notice " success!" - printDistInfo $binname + notice " build succeeded!" + + # now zip it all up + if zip -r $dir/$binname.zip tmp-build + then + printDistInfo $binname + rm -rf tmp-build + else + warn "failed to zip up output" + success=1 + fi else warn " failed." fi + # output results to results table echo $target, $goos, $goarch, $success >> $output/results } @@ -176,6 +192,8 @@ function startGoBuilds() { repopath=$GOPATH/src/$gpath + (cd $repopath && git reset --hard && git clean -df) + printVersions echo "" @@ -191,8 +209,6 @@ function startGoBuilds() { notice "build complete!" } # globals - - gpath=github.com/ipfs/go-ipfs/cmd/ipfs startGoBuilds go-ipfs $gpath From 2a85a36dc5db64e8d6905a5fef64fa4834102a57 Mon Sep 17 00:00:00 2001 From: Jeromy Johnson Date: Thu, 7 Jan 2016 12:20:46 +0100 Subject: [PATCH 17/36] better git cleanups --- dists/go-ipfs/build-versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index 43fb6951..25c7cae1 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -149,7 +149,7 @@ function checkoutVersion() { local ref=$2 echo "==> checking out version $ref in $repopath" - (cd $repopath && git checkout $ref > /dev/null) + (cd $repopath && git reset --hard && git clean -df && git checkout $ref > /dev/null) if [ "$?" != 0 ] then From afdd7ed1db6ebf5c159a33f8de7af8dd0695362a Mon Sep 17 00:00:00 2001 From: Jeromy Date: Thu, 7 Jan 2016 09:56:16 -0800 Subject: [PATCH 18/36] cleaner folder structure --- dists/go-ipfs/build-versions.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dists/go-ipfs/build-versions.sh b/dists/go-ipfs/build-versions.sh index 25c7cae1..0c2397e7 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/dists/go-ipfs/build-versions.sh @@ -67,7 +67,6 @@ function doBuild() { return fi echo " output to $dir" - mkdir -p $dir mkdir -p tmp-build @@ -79,12 +78,13 @@ function doBuild() { notice " build succeeded!" # now zip it all up - if zip -r $dir/$binname.zip tmp-build + mkdir -p $dir + if zip -r $dir/$binname.zip tmp-build > /dev/null then printDistInfo $binname rm -rf tmp-build else - warn "failed to zip up output" + warn " failed to zip up output" success=1 fi else From 3b6c402946dcd956e327b8b22949ce0c3143944d Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 8 Jan 2016 04:11:37 -0800 Subject: [PATCH 19/36] more generalized build script, and dist dir copying --- .../go-ipfs/build-versions.sh => build-go.sh | 44 ++++++++++++------- dists/go-ipfs/Makefile | 5 ++- 2 files changed, 33 insertions(+), 16 deletions(-) rename dists/go-ipfs/build-versions.sh => build-go.sh (86%) diff --git a/dists/go-ipfs/build-versions.sh b/build-go.sh similarity index 86% rename from dists/go-ipfs/build-versions.sh rename to build-go.sh index 0c2397e7..3710090c 100755 --- a/dists/go-ipfs/build-versions.sh +++ b/build-go.sh @@ -73,22 +73,28 @@ function doBuild() { (cd tmp-build && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) local success=$? local binname=$(basename $target) - if [ "$success" == 0 ] + if [ "$success" != 0 ] then - notice " build succeeded!" - - # now zip it all up - mkdir -p $dir - if zip -r $dir/$binname.zip tmp-build > /dev/null - then - printDistInfo $binname - rm -rf tmp-build - else - warn " failed to zip up output" - success=1 - fi - else warn " failed." + return 1 + fi + + notice " build succeeded!" + + # copy dist assets if they exist + if [ -e $GOPATH/src/$target/dist ]; then + cp -r $GOPATH/src/$target/dist/* tmp-build/ + fi + + # now zip it all up + mkdir -p $dir + if zip -r $dir/$binname.zip tmp-build > /dev/null + then + printDistInfo $binname + rm -rf tmp-build + else + warn " failed to zip up output" + success=1 fi @@ -148,8 +154,15 @@ function checkoutVersion() { local repopath=$1 local ref=$2 + if [ -z "$repopath" ] + then + fail "checkoutVersion: no repo to check out specified" + fi + echo "==> checking out version $ref in $repopath" - (cd $repopath && git reset --hard && git clean -df && git checkout $ref > /dev/null) + (cd $repopath && git reset --hard) + (cd $repopath && git clean -df) + (cd $repopath && git checkout $ref > /dev/null) if [ "$?" != 0 ] then @@ -208,6 +221,7 @@ function startGoBuilds() { notice "build complete!" } + # globals gpath=github.com/ipfs/go-ipfs/cmd/ipfs diff --git a/dists/go-ipfs/Makefile b/dists/go-ipfs/Makefile index 226409d9..c8ca0c0d 100644 --- a/dists/go-ipfs/Makefile +++ b/dists/go-ipfs/Makefile @@ -6,8 +6,11 @@ all: dist dist: versions mkdir -p $(releases) cp versions $(releases)/versions - ./build-versions.sh + ../../build-go.sh go-ipfs github.com/ipfs/go-ipfs/cmd/ipfs versions: filtered_versions git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions cat tag_versions | grep -f filtered_versions -vE > versions + +clean: + rm -rf $(releases) From 07052fd553203f8afa622ab4eb57b7a4e923a7fd Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 8 Jan 2016 04:15:55 -0800 Subject: [PATCH 20/36] fix zip output --- build-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-go.sh b/build-go.sh index 3710090c..4860284d 100755 --- a/build-go.sh +++ b/build-go.sh @@ -88,7 +88,7 @@ function doBuild() { # now zip it all up mkdir -p $dir - if zip -r $dir/$binname.zip tmp-build > /dev/null + if zip -r $dir/$binname.zip tmp-build/* > /dev/null then printDistInfo $binname rm -rf tmp-build From a295ba26e65ec0e34847085e3652fdf2decff769 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 8 Jan 2016 04:33:38 -0800 Subject: [PATCH 21/36] add ipfs-update to dists --- build-go.sh | 5 +---- dists/ipfs-update/Makefile | 22 ++++++++++++++++++++++ dists/ipfs-update/matrices/v1.0.0 | 10 ++++++++++ dists/ipfs-update/versions | 1 + 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 dists/ipfs-update/Makefile create mode 100644 dists/ipfs-update/matrices/v1.0.0 create mode 100644 dists/ipfs-update/versions diff --git a/build-go.sh b/build-go.sh index 4860284d..3bc2455e 100755 --- a/build-go.sh +++ b/build-go.sh @@ -222,7 +222,4 @@ function startGoBuilds() { notice "build complete!" } -# globals -gpath=github.com/ipfs/go-ipfs/cmd/ipfs - -startGoBuilds go-ipfs $gpath +startGoBuilds $1 $2 diff --git a/dists/ipfs-update/Makefile b/dists/ipfs-update/Makefile new file mode 100644 index 00000000..968ae9d7 --- /dev/null +++ b/dists/ipfs-update/Makefile @@ -0,0 +1,22 @@ +repo=http://github.com/ipfs/ipfs-update +releases=../../releases/ipfs-update + +all: dist + +dist: versions + mkdir -p $(releases) + cp versions $(releases)/versions + ../../build-go.sh ipfs-update github.com/ipfs/ipfs-update + +versions: filtered_versions + git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions + cat tag_versions | grep -f filtered_versions -vE > versions + +filtered_versions: + touch filtered_versions + +clean: + rm -rf ./gopath + rm -rf $(releases) + rm versions tag_versions + diff --git a/dists/ipfs-update/matrices/v1.0.0 b/dists/ipfs-update/matrices/v1.0.0 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/ipfs-update/matrices/v1.0.0 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/ipfs-update/versions b/dists/ipfs-update/versions new file mode 100644 index 00000000..0ec25f75 --- /dev/null +++ b/dists/ipfs-update/versions @@ -0,0 +1 @@ +v1.0.0 From 2b3b5b57f4efae7c1dd1c31957769d65de6e61a1 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 8 Jan 2016 04:58:43 -0800 Subject: [PATCH 22/36] add in fs-repo-migrations --- dists/fs-repo-migrations/Makefile | 22 ++++++++++++++++++++++ dists/fs-repo-migrations/matrices/v1.0.0 | 10 ++++++++++ dists/fs-repo-migrations/versions | 1 + 3 files changed, 33 insertions(+) create mode 100644 dists/fs-repo-migrations/Makefile create mode 100644 dists/fs-repo-migrations/matrices/v1.0.0 create mode 100644 dists/fs-repo-migrations/versions diff --git a/dists/fs-repo-migrations/Makefile b/dists/fs-repo-migrations/Makefile new file mode 100644 index 00000000..aa3913f8 --- /dev/null +++ b/dists/fs-repo-migrations/Makefile @@ -0,0 +1,22 @@ +repo=http://github.com/ipfs/fs-repo-migrations +releases=../../releases/fs-repo-migrations + +all: dist + +dist: versions + mkdir -p $(releases) + cp versions $(releases)/versions + ../../build-go.sh fs-repo-migrations github.com/ipfs/fs-repo-migrations + +versions: filtered_versions + git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions + cat tag_versions | grep -f filtered_versions -vE > versions + +filtered_versions: + touch filtered_versions + +clean: + rm -rf ./gopath + rm -rf $(releases) + rm versions tag_versions + diff --git a/dists/fs-repo-migrations/matrices/v1.0.0 b/dists/fs-repo-migrations/matrices/v1.0.0 new file mode 100644 index 00000000..2c416b0d --- /dev/null +++ b/dists/fs-repo-migrations/matrices/v1.0.0 @@ -0,0 +1,10 @@ +darwin 386 +darwin amd64 +freebsd 386 +freebsd amd64 +freebsd arm +linux 386 +linux amd64 +linux arm +windows 386 +windows amd64 diff --git a/dists/fs-repo-migrations/versions b/dists/fs-repo-migrations/versions new file mode 100644 index 00000000..0ec25f75 --- /dev/null +++ b/dists/fs-repo-migrations/versions @@ -0,0 +1 @@ +v1.0.0 From 05054ce5037e3ec847f24710223a9c6e1b575f1a Mon Sep 17 00:00:00 2001 From: Jeromy Date: Fri, 8 Jan 2016 06:53:31 -0800 Subject: [PATCH 23/36] better git commands and cleanup makefile --- Makefile | 10 +++------- build-go.sh | 16 +++++++++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 8f4b4a88..7f896aa7 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,9 @@ all: all_dists site -all_dists: go-ipfs +all_dists: go-ipfs ipfs-update fs-repo-migrations -ipfs-app: - echo "** making $@ **" - cd dists/$@ && make - -go-ipfs: - echo "** making $@ **" +%: + echo "** $@ **" cd dists/$@ && make site: diff --git a/build-go.sh b/build-go.sh index 3bc2455e..2c8fa21f 100755 --- a/build-go.sh +++ b/build-go.sh @@ -105,10 +105,15 @@ function doBuild() { function printInitialDistfile() { local distname=$1 local version=$2 + printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"releases/$distname/$version\"}" | jq ".name = \"$disname\"" | jq ".platforms = {}" | - jq ".description = \"`cat description`\"" + if [ -e description ]; then + jq ".description = \"`cat description`\"" + else + warn "no description file found" + fi } function printBuildInfo() { @@ -160,13 +165,14 @@ function checkoutVersion() { fi echo "==> checking out version $ref in $repopath" - (cd $repopath && git reset --hard) - (cd $repopath && git clean -df) - (cd $repopath && git checkout $ref > /dev/null) + reporoot=$(cd $repopath && git rev-parse --show-toplevel) + (cd $reporoot && git clean -df) + (cd $reporoot && git reset --hard) + (cd $reporoot && git checkout $ref > /dev/null) if [ "$?" != 0 ] then - fail "failed to check out $ref in $repopath" + fail "failed to check out $ref in $reporoot" fi } From 27f7e00732f5d55e5c75651648c275c50592d2cc Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sat, 9 Jan 2016 03:08:13 -0800 Subject: [PATCH 24/36] factor out a few things, and have a more specific directory check --- build-go.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/build-go.sh b/build-go.sh index 2c8fa21f..a65e89f5 100755 --- a/build-go.sh +++ b/build-go.sh @@ -155,6 +155,14 @@ function buildWithMatrix() { mv dist.json $output/dist.json } +function cleanRepo() { + local repopath=$1 + + reporoot=$(cd $repopath && git rev-parse --show-toplevel) + (cd $reporoot && git clean -df) + (cd $reporoot && git reset --hard) +} + function checkoutVersion() { local repopath=$1 local ref=$2 @@ -165,10 +173,8 @@ function checkoutVersion() { fi echo "==> checking out version $ref in $repopath" - reporoot=$(cd $repopath && git rev-parse --show-toplevel) - (cd $reporoot && git clean -df) - (cd $reporoot && git reset --hard) - (cd $reporoot && git checkout $ref > /dev/null) + cleanRepo $repopath + (cd $repopath && git checkout $ref > /dev/null) if [ "$?" != 0 ] then @@ -203,7 +209,7 @@ function startGoBuilds() { fi export GOPATH=$(pwd)/gopath - if [ ! -e $GOPATH ] + if [ ! -e $GOPATH/src/$gpath ] then echo "fetching $distname code..." go get $gpath 2> /dev/null From faebb8dd5f599c90dad931dc29e262c5a94f7b8f Mon Sep 17 00:00:00 2001 From: Jeromy Johnson Date: Sat, 9 Jan 2016 23:43:19 +0100 Subject: [PATCH 25/36] better filtering command that works on inferior operating systems --- dists/fs-repo-migrations/Makefile | 4 ++-- dists/go-ipfs/Makefile | 4 ++-- dists/ipfs-update/Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dists/fs-repo-migrations/Makefile b/dists/fs-repo-migrations/Makefile index aa3913f8..4c3a845d 100644 --- a/dists/fs-repo-migrations/Makefile +++ b/dists/fs-repo-migrations/Makefile @@ -9,8 +9,8 @@ dist: versions ../../build-go.sh fs-repo-migrations github.com/ipfs/fs-repo-migrations versions: filtered_versions - git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions - cat tag_versions | grep -f filtered_versions -vE > versions + git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' | sort > tag_versions + comm -23 -- tag_versions filtered_versions > versions filtered_versions: touch filtered_versions diff --git a/dists/go-ipfs/Makefile b/dists/go-ipfs/Makefile index c8ca0c0d..f893a7c7 100644 --- a/dists/go-ipfs/Makefile +++ b/dists/go-ipfs/Makefile @@ -9,8 +9,8 @@ dist: versions ../../build-go.sh go-ipfs github.com/ipfs/go-ipfs/cmd/ipfs versions: filtered_versions - git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions - cat tag_versions | grep -f filtered_versions -vE > versions + git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' | sort > tag_versions + comm -23 -- tag_versions filtered_versions > versions clean: rm -rf $(releases) diff --git a/dists/ipfs-update/Makefile b/dists/ipfs-update/Makefile index 968ae9d7..4a2c2177 100644 --- a/dists/ipfs-update/Makefile +++ b/dists/ipfs-update/Makefile @@ -9,8 +9,8 @@ dist: versions ../../build-go.sh ipfs-update github.com/ipfs/ipfs-update versions: filtered_versions - git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' > tag_versions - cat tag_versions | grep -f filtered_versions -vE > versions + git ls-remote -t $(repo) | egrep -o "refs/tags/v(.*)" | sed 's/refs\/tags\///' | sort > tag_versions + comm -23 -- tag_versions filtered_versions > versions filtered_versions: touch filtered_versions From aa8d8eb3f7c647e144043bac2b6ed4bd0bf84f7a Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sun, 10 Jan 2016 07:00:17 -0800 Subject: [PATCH 26/36] cleanup and add descriptions --- Makefile | 3 ++ build-go.sh | 69 ++++++++++------------------ dists/fs-repo-migrations/description | 1 + dists/ipfs-update/description | 1 + 4 files changed, 28 insertions(+), 46 deletions(-) create mode 100644 dists/fs-repo-migrations/description create mode 100644 dists/ipfs-update/description diff --git a/Makefile b/Makefile index 7f896aa7..840c3cfe 100644 --- a/Makefile +++ b/Makefile @@ -12,3 +12,6 @@ site: publish: all_dists site ipfs add -s rabin -q -r releases | tail -n1 >>versions + +clean: + rm -rf releases diff --git a/build-go.sh b/build-go.sh index a65e89f5..54d061fb 100755 --- a/build-go.sh +++ b/build-go.sh @@ -26,8 +26,7 @@ function notice() { reqbins="jq zip go" for b in $reqbins do - if ! type $b > /dev/null - then + if ! type $b > /dev/null; then fail "must have '$b' installed" fi done @@ -35,15 +34,13 @@ done function printDistInfo() { # print json output jq -e ".platforms[\"$goos\"]" dist.json > /dev/null - if [ ! $? -eq 0 ] - then + if [ ! $? -eq 0 ]; then cp dist.json dist.json.temp jq ".platforms[\"$goos\"] = {\"name\":\"$goos Binary\",\"archs\":{}}" dist.json.temp > dist.json fi local binname="$1" - if [ "$goos" = "windows" ] - then + if [ "$goos" = "windows" ]; then binname="$binname.exe" fi @@ -61,8 +58,7 @@ function doBuild() { echo "==> building for $goos $goarch" dir=$output/$1-$2 - if [ -e $dir ] - then + if [ -e $dir ]; then echo " $dir exists, skipping build" return fi @@ -71,10 +67,7 @@ function doBuild() { mkdir -p tmp-build (cd tmp-build && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) - local success=$? - local binname=$(basename $target) - if [ "$success" != 0 ] - then + if [ $? -ne 0 ]; then warn " failed." return 1 fi @@ -87,9 +80,9 @@ function doBuild() { fi # now zip it all up + local binname=$(basename $target) mkdir -p $dir - if zip -r $dir/$binname.zip tmp-build/* > /dev/null - then + if zip -r $dir/$binname.zip tmp-build/* > /dev/null; then printDistInfo $binname rm -rf tmp-build else @@ -105,15 +98,12 @@ function doBuild() { function printInitialDistfile() { local distname=$1 local version=$2 + test -e description || fail "no description file found" printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"releases/$distname/$version\"}" | jq ".name = \"$disname\"" | jq ".platforms = {}" | - if [ -e description ]; then - jq ".description = \"`cat description`\"" - else - warn "no description file found" - fi + jq ".description = \"`cat description`\"" } function printBuildInfo() { @@ -131,13 +121,8 @@ function buildWithMatrix() { local output=$3 local commit=$4 - if [ -z "$output" ]; then - fail "error: output dir not specified" - fi - - if [ ! -e $matfile ]; then - fail "build matrix $matfile does not exist" - fi + test -n "$output" || fail "error: output dir not specified" + test -e "$matfile" || fail "build matrix $matfile does not exist" mkdir -p $output @@ -158,28 +143,22 @@ function buildWithMatrix() { function cleanRepo() { local repopath=$1 - reporoot=$(cd $repopath && git rev-parse --show-toplevel) - (cd $reporoot && git clean -df) - (cd $reporoot && git reset --hard) + reporoot=$(cd "$repopath" && git rev-parse --show-toplevel) + (cd "$reporoot" && git clean -df) + (cd "$reporoot" && git reset --hard) } function checkoutVersion() { local repopath=$1 local ref=$2 - if [ -z "$repopath" ] - then - fail "checkoutVersion: no repo to check out specified" - fi + test -n "$repopath" || fail "checkoutVersion: no repo to check out specified" echo "==> checking out version $ref in $repopath" - cleanRepo $repopath - (cd $repopath && git checkout $ref > /dev/null) + cleanRepo "$repopath" + (cd "$repopath" && git checkout $ref > /dev/null) - if [ "$?" != 0 ] - then - fail "failed to check out $ref in $reporoot" - fi + test $? -eq 0 || fail "failed to check out $ref in $reporoot" } function currentSha() { @@ -199,25 +178,23 @@ function startGoBuilds() { distname=$1 gpath=$2 - outputDir=$releases/$distname + outputDir="$releases/$distname" # if the output directory already exists, warn user - if [ -e $outputDir ] - then + if [ -e $outputDir ]; then warn "dirty output directory" warn "will skip building already existing binaries" fi export GOPATH=$(pwd)/gopath - if [ ! -e $GOPATH/src/$gpath ] - then + if [ ! -e $GOPATH/src/$gpath ]; then echo "fetching $distname code..." go get $gpath 2> /dev/null fi - repopath=$GOPATH/src/$gpath + repopath="$GOPATH/src/$gpath" - (cd $repopath && git reset --hard && git clean -df) + (cd "$repopath" && git reset --hard && git clean -df) printVersions diff --git a/dists/fs-repo-migrations/description b/dists/fs-repo-migrations/description new file mode 100644 index 00000000..503dd7b0 --- /dev/null +++ b/dists/fs-repo-migrations/description @@ -0,0 +1 @@ +fs-repo-migrations is a tool to help migration ipfs storage repos to newer versions diff --git a/dists/ipfs-update/description b/dists/ipfs-update/description new file mode 100644 index 00000000..96beced9 --- /dev/null +++ b/dists/ipfs-update/description @@ -0,0 +1 @@ +ipfs-update is a cli tool to help update and install ipfs easily From 168989e45cfc9e3747d1df84d991677ad61b8146 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Sun, 10 Jan 2016 10:12:52 -0800 Subject: [PATCH 27/36] bash cleanup --- build-go.sh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/build-go.sh b/build-go.sh index 54d061fb..724622cc 100755 --- a/build-go.sh +++ b/build-go.sh @@ -124,9 +124,9 @@ function buildWithMatrix() { test -n "$output" || fail "error: output dir not specified" test -e "$matfile" || fail "build matrix $matfile does not exist" - mkdir -p $output + mkdir -p "$output" - local distname=$(basename $gobin) + local distname=$(basename "$gobin") printInitialDistfile $distname $version > dist.json printBuildInfo $commit > $output/build-info @@ -166,11 +166,7 @@ function currentSha() { } function printVersions() { - versarr="" - while read v - do - versarr="$versarr $v" - done < versions + versarr=$(tr \n ' ' < versions) echo "building versions: $versarr" } From 8cb7d6fbb333af6712a84fb35fcf6afd7c59ee8a Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Sun, 10 Jan 2016 22:35:09 +0100 Subject: [PATCH 28/36] Fix site for new dist.json format and add navigation --- package.json | 1 + site/public/_js/script.js | 5 ++++- site/public/_layout.jade | 2 +- site/public/css/_base.less | 5 +---- site/public/css/_component.less | 19 +++++++++++++++---- site/public/css/_sidebar.less | 17 ++++++++++------- site/public/css/_variables.less | 2 +- site/public/index.jade | 26 ++++++++++++++------------ 8 files changed, 47 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 56b9f4c3..2066c43a 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "pre-commit": "^1.1.2", "require-dir": "^0.3.0", "run-sequence": "^1.1.5", + "stickyfill": "^1.1.1", "tether": "^1.1.1", "webpack": "^1.12.2", "webpack-stream": "^3.1.0" diff --git a/site/public/_js/script.js b/site/public/_js/script.js index 577bbe67..89f7e918 100644 --- a/site/public/_js/script.js +++ b/site/public/_js/script.js @@ -1,3 +1,6 @@ -window.jQuery = require('jquery') +const $ = window.jQuery = require('jquery') window.Tether = require('tether') +const Stickyfill = require('stickyfill')() require('bootstrap') + +Stickyfill.add($('.sticky')[0]) diff --git a/site/public/_layout.jade b/site/public/_layout.jade index f5450b79..03fabf3a 100644 --- a/site/public/_layout.jade +++ b/site/public/_layout.jade @@ -12,6 +12,6 @@ html(lang='en') rel='stylesheet' type='text/css' ) - body + body(data-spy='scroll' data-target='#d-navbar') != yield script(src='build/script.js') \ No newline at end of file diff --git a/site/public/css/_base.less b/site/public/css/_base.less index ff05e869..304c4e1e 100644 --- a/site/public/css/_base.less +++ b/site/public/css/_base.less @@ -1,10 +1,7 @@ body { font-family: 'Fira Sans', sans-serif; line-height: @baseLineHeight; -} - -.container { - margin-top: 88px; + position: relative; } .bg-inverse { diff --git a/site/public/css/_component.less b/site/public/css/_component.less index cd32d190..b2b1a6da 100644 --- a/site/public/css/_component.less +++ b/site/public/css/_component.less @@ -1,14 +1,20 @@ .d-component { + padding-top: 4 * @baseLineHeight; + padding-bottom: 3 * @baseLineHeight; + border-bottom: 1px solid @borderGray; + &:first-child { + padding-top: 5 * @baseLineHeight; + } } .d-component-desc-title { - font-size: 18px; + font-size: 22px; font-weight: 500; } .d-component-desc-sub-title { - font-size: 16px; + font-size: 18px; font-weight: 300; } @@ -63,13 +69,18 @@ border-bottom: 1px solid @borderGray; border-top: none; - transition: all 0.3s linear; + transition: background 0.3s linear; - &:hover { + &:hover{ background-color: @baseBlue; color: @white; cursor: pointer; } + &:hover a, + a:hover { + color: @white; + cursor: pointer; + } } tr:last-child { diff --git a/site/public/css/_sidebar.less b/site/public/css/_sidebar.less index 6ef868ba..75ea2aeb 100644 --- a/site/public/css/_sidebar.less +++ b/site/public/css/_sidebar.less @@ -1,14 +1,12 @@ @leftBorderWidth: 2px; +.d-sidebar-wrapper { + top: 4.8 * @baseLineHeight; + position: sticky; +} + .d-sidebar-item { line-height: 27px; - - &.active { - .d-sidebar-link { - border-left: @leftBorderWidth solid @baseBlue; - color: @baseBlue; - } - } } .d-sidebar-link { @@ -21,6 +19,11 @@ transition: color 0.4s linear; + &.active { + border-left: @leftBorderWidth solid @baseBlue; + color: @baseBlue; + } + &:hover { color: @baseBlue; cursor: pointer; diff --git a/site/public/css/_variables.less b/site/public/css/_variables.less index 86788c88..9db5ced4 100644 --- a/site/public/css/_variables.less +++ b/site/public/css/_variables.less @@ -9,5 +9,5 @@ @white: #FFFFFF; @baseBlue: #6282d7; @linkBlue: #076fad; -@lightGray: #777777; +@lightGray: #6b6b6b; @borderGray: #ebebeb; \ No newline at end of file diff --git a/site/public/index.jade b/site/public/index.jade index 217d7805..f971f3b2 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -1,28 +1,30 @@ -- version = 'v0.3.8' nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse - a.navbar-brand IPFS distributions + .container + .row + a.navbar-brand IPFS distributions .container .row - .col-md-2 + .d-sidebar-wrapper.col-md-2.sticky .d-sidebar ul.nav#d-navbar: each value, key in public.releases li.d-sidebar-item.nav-item - a.d-sidebar-link.nav-item(href='##{key}')= key + a.d-sidebar-link.nav-link(href='##{key}')= key .col-md-10: each value, key in public.releases - .d-component + .d-component(id='#{key}') - data = value._data .d-component-desc.row .col-md-8 h1.d-component-desc-title - = data.name + = key h2.d-component-desc-sub-title = data.tagline .d-component-desc-body != partial('releases/' + key + '/index') - .d-component-asset.col-md-4 - a(href="https://asciinema.org/a/#{data.ascii}" target='_blank') - img(src="https://asciinema.org/a/#{data.ascii}.png" width='260') + if data.ascii + .d-component-asset.col-md-4 + a(href="https://asciinema.org/a/#{data.ascii}" target='_blank') + img(src="https://asciinema.org/a/#{data.ascii}.png" width='260') .d-component-release.row .col-md-4 @@ -39,9 +41,9 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse table.table.d-download-table tbody for p in data.platforms - - colspan = 6 / p.archs.length + - colspan = 6 / Object.keys(p.archs).length tr th= p.name - for arch in p.archs + for arch, name in p.archs td(colspan="#{colspan}") - a(href="#{data.releaseLink}/#{arch.link}")= arch.name + a(href="#{data.releaseLink}/#{arch.link}")= name From ba5e4aaf5ac7a66e4ee900218fc9502981dc2ac2 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Sun, 10 Jan 2016 22:49:22 +0100 Subject: [PATCH 29/36] Add footer --- site/public/_footer.jade | 10 ++++++++++ site/public/_header.jade | 6 ++++++ site/public/css/_footer.less | 8 ++++++++ site/public/css/_header.less | 3 +++ site/public/css/style.less | 2 ++ site/public/index.jade | 7 +++---- 6 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 site/public/_footer.jade create mode 100644 site/public/_header.jade create mode 100644 site/public/css/_footer.less create mode 100644 site/public/css/_header.less diff --git a/site/public/_footer.jade b/site/public/_footer.jade new file mode 100644 index 00000000..45c1eb90 --- /dev/null +++ b/site/public/_footer.jade @@ -0,0 +1,10 @@ +footer.d-footer + .container + .row + | © Interplanetary Networks, Inc. | + | Except as + a(href='http://ipn.io/legal/policies') noted + | , content licensed + a(href='https://creativecommons.org/licenses/by/3.0/') CC-BY 3.0 + | | Source on + a(href='https://github.com/ipfs/distributions') Github diff --git a/site/public/_header.jade b/site/public/_header.jade new file mode 100644 index 00000000..cd924e8b --- /dev/null +++ b/site/public/_header.jade @@ -0,0 +1,6 @@ +nav.d-header.navbar.navbar-fixed-top.navbar-dark.bg-inverse + .container + .row + a.navbar-brand + | IPFS + span.d-header-light distributions diff --git a/site/public/css/_footer.less b/site/public/css/_footer.less new file mode 100644 index 00000000..0845f1ec --- /dev/null +++ b/site/public/css/_footer.less @@ -0,0 +1,8 @@ +.d-footer { + text-align: center; + color: @lightGray; + font-size: 14px; + font-weight: 300; + margin-top: 5 * @baseLineHeight; + padding: @baseLineHeight; +} \ No newline at end of file diff --git a/site/public/css/_header.less b/site/public/css/_header.less new file mode 100644 index 00000000..112c8438 --- /dev/null +++ b/site/public/css/_header.less @@ -0,0 +1,3 @@ +.d-header-light { + font-weight: 300; +} diff --git a/site/public/css/style.less b/site/public/css/style.less index 4071e2da..8abe11a3 100644 --- a/site/public/css/style.less +++ b/site/public/css/style.less @@ -3,5 +3,7 @@ @import './_variables'; @import './_base'; +@import './_header'; +@import './_footer'; @import './_sidebar'; @import './_component'; diff --git a/site/public/index.jade b/site/public/index.jade index f971f3b2..1ffaadf6 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -1,7 +1,4 @@ -nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse - .container - .row - a.navbar-brand IPFS distributions +include ./_header.jade .container .row @@ -47,3 +44,5 @@ nav.navbar.navbar-fixed-top.navbar-dark.bg-inverse for arch, name in p.archs td(colspan="#{colspan}") a(href="#{data.releaseLink}/#{arch.link}")= name + +include ./_footer.jade \ No newline at end of file From a7c59a996d0c522c59972790462f288c72a795bf Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Sun, 10 Jan 2016 23:59:42 +0100 Subject: [PATCH 30/36] Make usable on mobile --- package.json | 1 + site/public/_header.jade | 7 +++++++ site/public/_js/script.js | 1 + site/public/css/_base.less | 4 ++++ site/public/css/_component.less | 15 +++++++++++++-- site/public/css/_footer.less | 10 +++++++++- site/public/css/_header.less | 5 +++++ site/public/css/_sidebar.less | 16 +++++++++++++--- site/public/css/style.less | 1 + site/public/index.jade | 2 +- 10 files changed, 55 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 2066c43a..4349d105 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "gulpfile.babel.js", "dependencies": {}, "devDependencies": { + "Bootstrap-Offcanvas": "github:iamphill/Bootstrap-Offcanvas", "async": "^1.5.0", "babel-core": "^6.1.2", "babel-eslint": "^5.0.0-beta6", diff --git a/site/public/_header.jade b/site/public/_header.jade index cd924e8b..b68c2c99 100644 --- a/site/public/_header.jade +++ b/site/public/_header.jade @@ -4,3 +4,10 @@ nav.d-header.navbar.navbar-fixed-top.navbar-dark.bg-inverse a.navbar-brand | IPFS span.d-header-light distributions + + button#d-toggle.navbar-toggler.offcanvas-toggle.hidden-sm-up.pull-right( + type='button' + data-toggle='offcanvas' + data-target='#d-navbar-offcanvas' + ) + | ☰ diff --git a/site/public/_js/script.js b/site/public/_js/script.js index 89f7e918..a4ed2bc6 100644 --- a/site/public/_js/script.js +++ b/site/public/_js/script.js @@ -2,5 +2,6 @@ const $ = window.jQuery = require('jquery') window.Tether = require('tether') const Stickyfill = require('stickyfill')() require('bootstrap') +require('bootstrap-offcanvas/dist/js/bootstrap.offcanvas.js') Stickyfill.add($('.sticky')[0]) diff --git a/site/public/css/_base.less b/site/public/css/_base.less index 304c4e1e..4bf2963c 100644 --- a/site/public/css/_base.less +++ b/site/public/css/_base.less @@ -17,4 +17,8 @@ a { text-decoration: none; cursor: pointer; } +} + +.pull-right { + float: right; } \ No newline at end of file diff --git a/site/public/css/_component.less b/site/public/css/_component.less index b2b1a6da..31d386f4 100644 --- a/site/public/css/_component.less +++ b/site/public/css/_component.less @@ -4,7 +4,7 @@ border-bottom: 1px solid @borderGray; &:first-child { - padding-top: 5 * @baseLineHeight; + padding-top: 0; } } @@ -53,6 +53,7 @@ .d-download-table { font-size: 14px; line-height: 36px; + margin-top: 2 * @baseLineHeight; th { font-weight: 400; @@ -89,4 +90,14 @@ border-bottom: none; } } -} \ No newline at end of file +} + +@media (min-width: 768px) { + .d-component:first-child { + padding-top: 5 * @baseLineHeight; + } + + .d-download-table { + margin-top: 0; + } +} diff --git a/site/public/css/_footer.less b/site/public/css/_footer.less index 0845f1ec..b5d2762d 100644 --- a/site/public/css/_footer.less +++ b/site/public/css/_footer.less @@ -3,6 +3,14 @@ color: @lightGray; font-size: 14px; font-weight: 300; - margin-top: 5 * @baseLineHeight; + margin-top: 2 * @baseLineHeight; padding: @baseLineHeight; + min-height: 100px; +} + +@media (min-width: 768px) { + .d-footer { + margin-top: 5 * @baseLineHeight; + min-height: 0; + } } \ No newline at end of file diff --git a/site/public/css/_header.less b/site/public/css/_header.less index 112c8438..89e9a563 100644 --- a/site/public/css/_header.less +++ b/site/public/css/_header.less @@ -1,3 +1,8 @@ .d-header-light { font-weight: 300; } + +#d-toggle { + background: transparent; + padding: 0; +} \ No newline at end of file diff --git a/site/public/css/_sidebar.less b/site/public/css/_sidebar.less index 75ea2aeb..f8aefa06 100644 --- a/site/public/css/_sidebar.less +++ b/site/public/css/_sidebar.less @@ -1,8 +1,9 @@ @leftBorderWidth: 2px; .d-sidebar-wrapper { - top: 4.8 * @baseLineHeight; - position: sticky; + top: 2 * @baseLineHeight; + background: #FFFFFF; + padding-top: @baseLineHeight; } .d-sidebar-item { @@ -28,4 +29,13 @@ color: @baseBlue; cursor: pointer; } -} \ No newline at end of file +} + +@media (min-width: 768px) { + .d-sidebar-wrapper { + top: 4.8 * @baseLineHeight; + position: sticky; + background: #FFFFFF; + padding-top: 0; + } +} diff --git a/site/public/css/style.less b/site/public/css/style.less index 8abe11a3..093a8901 100644 --- a/site/public/css/style.less +++ b/site/public/css/style.less @@ -1,4 +1,5 @@ @import (inline) '../../../node_modules/bootstrap/dist/css/bootstrap.css'; +@import (inline) '../../../node_modules/bootstrap-offcanvas/dist/css/bootstrap.offcanvas.css'; @import './_variables'; @import './_base'; diff --git a/site/public/index.jade b/site/public/index.jade index 1ffaadf6..4fa857db 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -2,7 +2,7 @@ include ./_header.jade .container .row - .d-sidebar-wrapper.col-md-2.sticky + .d-sidebar-wrapper.col-md-2.sticky.navbar-offcanvas#d-navbar-offcanvas .d-sidebar ul.nav#d-navbar: each value, key in public.releases li.d-sidebar-item.nav-item From e321ea24d6a97acec77a66d571a78c258993f912 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Mon, 11 Jan 2016 10:38:48 -0800 Subject: [PATCH 31/36] some more cleanup --- .gitignore | 4 +++- build-go.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ce5a4c47..17067cdf 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ logs **/node_modules releases dists/ipfs-app/build -www \ No newline at end of file +www +**/gopath +**/tmp-build diff --git a/build-go.sh b/build-go.sh index 724622cc..1e545d93 100755 --- a/build-go.sh +++ b/build-go.sh @@ -46,7 +46,7 @@ function printDistInfo() { cp dist.json dist.json.temp jq ".platforms[\"$goos\"].archs[\"$goarch\"] = {\"link\":\"$goos-$goarch/$binname\"}" dist.json.temp > dist.json - + rm dist.json.temp } function doBuild() { From 77af6dabf66d1f0b0261ce36aa509c9c6054de2b Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 11 Jan 2016 21:51:47 +0100 Subject: [PATCH 32/36] Copy improvements Part 1 --- build-go.sh | 6 +++--- site/public/index.jade | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build-go.sh b/build-go.sh index 1e545d93..a0cae8e0 100755 --- a/build-go.sh +++ b/build-go.sh @@ -67,7 +67,7 @@ function doBuild() { mkdir -p tmp-build (cd tmp-build && GOOS=$goos GOARCH=$goarch go build $target 2> build-log) - if [ $? -ne 0 ]; then + if [ $? -ne 0 ]; then warn " failed." return 1 fi @@ -100,7 +100,7 @@ function printInitialDistfile() { local version=$2 test -e description || fail "no description file found" - printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"releases/$distname/$version\"}" | + printf "{\"id\":\"$distname\",\"version\":\"$version\",\"releaseLink\":\"/$distname/$version\"}" | jq ".name = \"$disname\"" | jq ".platforms = {}" | jq ".description = \"`cat description`\"" @@ -110,7 +110,7 @@ function printBuildInfo() { # print out build information local commit=$1 go version - echo "git sha of code: $commit" + echo "git sha of code: $commit" uname -a echo built on `date` } diff --git a/site/public/index.jade b/site/public/index.jade index 4fa857db..b143425c 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -1,5 +1,8 @@ include ./_header.jade +- targetMap = {'386': '32-bit', 'amd64': '64-bit', 'arm': 'ARM'} +- architectureMap = {'darwin Binary': 'Mac OS X Binary', 'freebsd Binary': 'FreeBSD Binary', 'linux Binary': 'Linux Binary', 'windows Binary': 'Windows Binary'} + .container .row .d-sidebar-wrapper.col-md-2.sticky.navbar-offcanvas#d-navbar-offcanvas @@ -40,9 +43,9 @@ include ./_header.jade for p in data.platforms - colspan = 6 / Object.keys(p.archs).length tr - th= p.name - for arch, name in p.archs + th= architectureMap[p.name] + for arch, target in p.archs td(colspan="#{colspan}") - a(href="#{data.releaseLink}/#{arch.link}")= name + a(href="#{data.releaseLink}/#{arch.link}")= targetMap[target] include ./_footer.jade \ No newline at end of file From 64bb28d5db80a5c6e32da653f963d3a672086a03 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Mon, 11 Jan 2016 21:52:14 +0100 Subject: [PATCH 33/36] site: Copy site into releases folder --- tasks/build.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/build.js b/tasks/build.js index 40e2d0e3..3ec25ced 100644 --- a/tasks/build.js +++ b/tasks/build.js @@ -20,11 +20,18 @@ gulp.task('harp:compile', done => { harp.compile('./site', '../www', done) }) +gulp.task('copy:site', done => { + return gulp.src(['./www/**/*']) + .pipe(gulp.dest('./releases')) +}) + gulp.task('build', done => { runSequence( ['clean', 'dist'], 'webpack:prod', 'harp:compile', + 'copy:site', + 'clean', done ) }) From c4b71b71da4ea6515ad2d9e5b2ff41c4424050c6 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Tue, 12 Jan 2016 07:02:52 -0800 Subject: [PATCH 34/36] proper dist naming and add zip to links --- build-go.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build-go.sh b/build-go.sh index a0cae8e0..d3606fe5 100755 --- a/build-go.sh +++ b/build-go.sh @@ -40,12 +40,8 @@ function printDistInfo() { fi local binname="$1" - if [ "$goos" = "windows" ]; then - binname="$binname.exe" - fi - cp dist.json dist.json.temp - jq ".platforms[\"$goos\"].archs[\"$goarch\"] = {\"link\":\"$goos-$goarch/$binname\"}" dist.json.temp > dist.json + jq ".platforms[\"$goos\"].archs[\"$goarch\"] = {\"link\":\"$goos-$goarch/$binname.zip\"}" dist.json.temp > dist.json rm dist.json.temp } @@ -126,7 +122,7 @@ function buildWithMatrix() { mkdir -p "$output" - local distname=$(basename "$gobin") + local distname=$(basename `pwd`) printInitialDistfile $distname $version > dist.json printBuildInfo $commit > $output/build-info From c8ccbd2e0bcb46a279b3d61b5a3126cc7864c6c4 Mon Sep 17 00:00:00 2001 From: dignifiedquire Date: Tue, 12 Jan 2016 18:07:15 +0100 Subject: [PATCH 35/36] Fix absolute paths --- site/public/index.jade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/public/index.jade b/site/public/index.jade index b143425c..caa85e8f 100644 --- a/site/public/index.jade +++ b/site/public/index.jade @@ -46,6 +46,7 @@ include ./_header.jade th= architectureMap[p.name] for arch, target in p.archs td(colspan="#{colspan}") - a(href="#{data.releaseLink}/#{arch.link}")= targetMap[target] + - link = data.releaseLink.replace(/^\//, '') + '/' + arch.link + a(href="#{link}")= targetMap[target] include ./_footer.jade \ No newline at end of file From b8dd155013ee5aef83db0d590cb0331b85f3caa3 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Tue, 12 Jan 2016 12:36:13 -0800 Subject: [PATCH 36/36] add current version files --- dists/fs-repo-migrations/current | 1 + dists/go-ipfs/current | 1 + dists/ipfs-update/current | 1 + 3 files changed, 3 insertions(+) create mode 100644 dists/fs-repo-migrations/current create mode 100644 dists/go-ipfs/current create mode 100644 dists/ipfs-update/current diff --git a/dists/fs-repo-migrations/current b/dists/fs-repo-migrations/current new file mode 100644 index 00000000..0ec25f75 --- /dev/null +++ b/dists/fs-repo-migrations/current @@ -0,0 +1 @@ +v1.0.0 diff --git a/dists/go-ipfs/current b/dists/go-ipfs/current new file mode 100644 index 00000000..bf15550d --- /dev/null +++ b/dists/go-ipfs/current @@ -0,0 +1 @@ +v0.3.11 diff --git a/dists/ipfs-update/current b/dists/ipfs-update/current new file mode 100644 index 00000000..0ec25f75 --- /dev/null +++ b/dists/ipfs-update/current @@ -0,0 +1 @@ +v1.0.0