From 712ead7e6e45650add640a6be416611dfdfe1464 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 6 Jul 2017 01:01:59 +0800 Subject: [PATCH 1/3] Refactor to make test-build.sh shorter --- test-build.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test-build.sh b/test-build.sh index 89c40ea5..aa64fbdf 100755 --- a/test-build.sh +++ b/test-build.sh @@ -34,16 +34,14 @@ for version in "${versions[@]}"; do if ! docker build -t node:"$tag" "$version"; then fatal "Build of $tag failed!" - else - info "Build of $tag succeeded." fi + info "Build of $tag succeeded." OUTPUT=$(docker run --rm -it node:"$tag" node -e "process.stdout.write(process.versions.node)") if [ "$OUTPUT" != "$tag" ]; then fatal "Test of $tag failed!" - else - info "Test of $tag succeeded." fi + info "Test of $tag succeeded." variants=$(echo "$version"/*/ | xargs -n1 basename) @@ -55,16 +53,14 @@ for version in "${versions[@]}"; do if ! docker build -t node:"$tag-$variant" "$version/$variant"; then fatal "Build of $tag-$variant failed!" - else - info "Build of $tag-$variant succeeded." fi + info "Build of $tag-$variant succeeded." OUTPUT=$(docker run --rm -it node:"$tag-$variant" node -e "process.stdout.write(process.versions.node)") if [ "$OUTPUT" != "$tag" ]; then fatal "Test of $tag-$variant failed!" - else - info "Test of $tag-$variant succeeded." fi + info "Test of $tag-$variant succeeded." done From 0ac987d1112b6d795173773274dd21737f09a08d Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 6 Jul 2017 01:16:48 +0800 Subject: [PATCH 2/3] Refactor .travis.yml to speed up Travis CI Separate shellcheck and only install shellcheck package for it. --- .travis.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 17eb8789..e8b1c94c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,20 +3,22 @@ sudo: required services: - docker -addons: - apt: - sources: - - debian-sid - packages: - - shellcheck - script: - - shellcheck *.sh - - ./test-build.sh $NODE_VERSION + - if [ "true" = "${SHELLCHECK-}" ]; then shellcheck *.sh ; fi + - if [ -n "${NODE_VERSION-}" ]; then ./test-build.sh $NODE_VERSION ; fi env: - matrix : - - NODE_VERSION: '4.8' - - NODE_VERSION: '6.11' - - NODE_VERSION: '7.10' - - NODE_VERSION: '8.1' + - NODE_VERSION: '4.8' + - NODE_VERSION: '6.11' + - NODE_VERSION: '7.10' + - NODE_VERSION: '8.1' + +matrix: + include: + env: SHELLCHECK=true + addons: + apt: + sources: + - debian-sid + packages: + - shellcheck From 876f13a0eac75cea08bb0c433356c8597eca0745 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 6 Jul 2017 14:58:22 +0800 Subject: [PATCH 3/3] Use doctoc to check if "Table of Contents" up-to-date --- .travis.yml | 8 ++++++++ README.md | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8b1c94c..7bceaf35 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,16 @@ services: script: - if [ "true" = "${SHELLCHECK-}" ]; then shellcheck *.sh ; fi - if [ -n "${NODE_VERSION-}" ]; then ./test-build.sh $NODE_VERSION ; fi + - if [ "true" = "${DOCTOCCHECK-}" ]; then + nvm install node && + npm i -g doctoc && + cp README.md README.md.tmp && + doctoc --title='## Table of Contents' --github README.md && + diff -q README.md README.md.tmp; + fi env: + - DOCTOCCHECK: true - NODE_VERSION: '4.8' - NODE_VERSION: '6.11' - NODE_VERSION: '7.10' diff --git a/README.md b/README.md index 3c2dc5fc..a2c91cf6 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ The official Node.js docker image, made with love by the node community. + + ## Table of Contents - [What is Node.js?](#what-is-nodejs) @@ -30,6 +32,8 @@ The official Node.js docker image, made with love by the node community. - [Docker Working Group Members](#docker-working-group-members) - [Docker Working Group Collaborators](#docker-working-group-collaborators) + + ## What is Node.js? Node.js is a platform built on Chrome's JavaScript runtime for easily building