From 0c5b61015949c0ae328c2af5fa35b4076e2a5e7e Mon Sep 17 00:00:00 2001 From: Pixelastic Date: Mon, 20 Aug 2018 13:51:59 +0200 Subject: [PATCH] docs(deploy): Update deploy documentation system --- .travis.yml | 14 +------------- README.md | 2 +- netlify.toml | 2 -- package.json | 2 +- scripts/finish-release | 25 ------------------------- scripts/release | 26 ++++++++++++++------------ scripts/test-ci | 10 ---------- 7 files changed, 17 insertions(+), 64 deletions(-) delete mode 100644 netlify.toml delete mode 100755 scripts/finish-release delete mode 100755 scripts/test-ci diff --git a/.travis.yml b/.travis.yml index 96261042..3727e331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,6 @@ language: node_js -before_install: -- git config --global user.email "algobot@users.noreply.github.com" -- git config --global user.name "algobot" -- rvm install 2.4.2 -- rvm use 2.4.2 -script: "./scripts/test-ci" +script: "./scripts/test" sudo: false branches: only: - master -cache: - bundler: true -# before_cache: -# - rm -f ./node_modules/.bin/which -env: - global: - secure: TDLpvycpMbbXpwSKLLeDBZdpi05rbZEbPcII9LSglUG9teF/zrqxRMl+Eivvho8IkeJRDQVwdc8EbYCzZ9cAwRHOyqzDNwRFhlpKVwz+fl5uHfxDo5DANsut6F+l/RrBf4n2MWKkJlbo4kq8mUqL89vcPqfRTLpx62FawywDgiJc2s+ixR1lkm5GNlF74ovoUkeOXiLi605LE0sN7H/1TRdD6WOJTBT2yoiuDU3U/RUKJxka6Sz4u9kqUQpn+kJUIPiBiasbz65qglnrxpBL/mYgAEZfRcbVyC5zd+CeFSIlIiGdhMFoVInNMqshq7gl/UWcJyxdnGIIfhO3l/Y/lyEXQQknEZS4M2h7UKeCuu0E1hh7eT7kVVyXDW+nCUNVYPTuupvLwcpnXw02Flef72OpDy6bl19NEdH79lNK4l440GJb+Lhda2M2mMZJmRkg31j9HFjl0wCYqRopzNTKNBFJAPTB4rG6H/y7NgPFjrATphEDLZgq73eNDxtRNBQHtLqGl8IsaFHU4+8vAQ2iEbi5+R/D5Rua2BXSbYAdQjxnvmPojQ7voZgj+w5GHx2573plCvqO4pZvV/u5/Z18tEYIV+4LFC7KR+30Snbk0JAbRogQr6P4mkVrKG/7pAcGS5tpxhMY3OUNaJWdDP8NE1c3/0Q2pKqdB0RauGoUO2w= diff --git a/README.md b/README.md index a7ec1712..e0b31892 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Check out our [website][1] to add an outstanding search to your documentation. [travis-svg]: https://img.shields.io/travis/algolia/docsearch/master.svg?style=flat-square [travis-url]: https://travis-ci.org/algolia/docsearch.svg?branch=master [coveralls-svg]: https://img.shields.io/coveralls/algolia/docsearch/master.svg?style=flat-square -[coveralls-url]: https://coveralls.io/github/algolia/docsearch?branch=docs%2Fbadges +[coveralls-url]: https://coveralls.io/github/algolia/docsearch?branch=master [license-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square diff --git a/netlify.toml b/netlify.toml deleted file mode 100644 index 88e8ef98..00000000 --- a/netlify.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] - base = "docs" \ No newline at end of file diff --git a/package.json b/package.json index e195d2a7..0ff4cc35 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "build:css": "./scripts/build-css", "build:js": "./scripts/build-js", "docs:build": "cd ./docs && yarn build", - "docs:lint": "cd ./docs && yarn lint", "docs:serve": "cd ./docs && yarn serve", + "docs:deploy": "cd ./docs && yarn deploy", "doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md", "lint": "./scripts/lint", "release": "./scripts/release", diff --git a/scripts/finish-release b/scripts/finish-release deleted file mode 100755 index 2081940f..00000000 --- a/scripts/finish-release +++ /dev/null @@ -1,25 +0,0 @@ -#! /usr/bin/env bash -[ -z $CI ] && CI='false' - -if [ $CI != 'true' ]; then - printf "finish-release: Only doable on CI\n" - exit 1 -fi - -set -ev # exit when error - -VERSION=`cat package.json | json version` -JSDELIVER_URL="http://cdn.jsdelivr.net/docsearch.js/$VERSION/docsearch.min.js" - -while true; do - STATUS=$(curl -L -I $JSDELIVER_URL 2>/dev/null | head -n 1 | cut -d$' ' -f2); - if [ $STATUS == '200' ]; then - printf "$VERSION is now available on jsDelivr\n" - break; - else - printf "$VERSION is not yet published on jsDelivr, retrying in 30s (status was $STATUS)\n" - fi - sleep 30 -done - -./scripts/docs/update-website diff --git a/scripts/release b/scripts/release index 13167346..68671be5 100755 --- a/scripts/release +++ b/scripts/release @@ -8,8 +8,8 @@ then exit 1 fi -currentBranch=`git rev-parse --abbrev-ref HEAD` -if [ $currentBranch != 'master' ]; then +currentBranch=$(git rev-parse --abbrev-ref HEAD) +if [ "$currentBranch" != 'master' ]; then printf "Release: You must be on master" exit 1 fi @@ -26,13 +26,17 @@ git fetch origin --tags printf "Release: npm install" npm install -currentVersion=`cat package.json | json version` +currentVersion=$(json version < package.json) # header -printf "\n\nRelease: current version is $currentVersion" -printf "\nRelease: a changelog will be generated only if a fix/feat/performance/breaking token is found in git log" -printf "\nRelease: you must choose a new ve.rs.ion (semver)" -printf "\nRelease: press q to exit the next screen\n\n" +echo "" +echo "Release: current version is $currentVersion" +echo "Release: a changelog will be generated only if a fix/feat/performance/breaking token is found in git log" +echo "Release: you must choose a new ve.rs.ion (semver)" +echo "Release: press q to exit the next screen" +echo "" +echo "" + # preview changelog read -p "=> Release: press [ENTER] to view changes since latest version.." @@ -50,7 +54,7 @@ NODE_ENV=production VERSION=$newVersion npm run build # update changelog printf "\n\nRelease: update changelog" -changelog=`conventional-changelog -p angular` +changelog=$(conventional-changelog -p angular) conventional-changelog --preset angular --infile CHANGELOG.md --same-file -r 0 # regenerate readme TOC @@ -60,7 +64,7 @@ npm run doctoc # git add and tag commitMessage="v$newVersion\n\n$changelog" git add src/lib/version.js package.json CHANGELOG.md README.md CONTRIBUTING.md -printf "$commitMessage" | git commit --file - +echo "$commitMessage" | git commit --file - git tag "v$newVersion" printf "\n\nRelease: almost done, check everything in another terminal tab.\n" @@ -71,6 +75,4 @@ git push origin master git push origin --tags npm publish -printf "Release: -Package was published to npm. -A job on travis-ci will be automatically launched to finalize the release." +printf "Release: Package was published to npm." diff --git a/scripts/test-ci b/scripts/test-ci deleted file mode 100755 index 0bd608d5..00000000 --- a/scripts/test-ci +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -set -ev # exit when error - -npm run test -NODE_ENV=production npm run build - -if [ "$TRAVIS_PULL_REQUEST" == 'false' ] && [ "$TRAVIS_BRANCH" == 'master' ]; then - ./scripts/finish-release -fi