1
0
Fork 0

docs(deploy): Update deploy documentation system

This commit is contained in:
Pixelastic 2018-08-20 13:51:59 +02:00
parent e60acbda47
commit 0c5b610159
7 changed files with 17 additions and 64 deletions

View file

@ -1,18 +1,6 @@
language: node_js language: node_js
before_install: script: "./scripts/test"
- 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"
sudo: false sudo: false
branches: branches:
only: only:
- master - 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=

View file

@ -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-svg]: https://img.shields.io/travis/algolia/docsearch/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/algolia/docsearch.svg?branch=master [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-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-image]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square
[license-url]: LICENSE [license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square [downloads-image]: https://img.shields.io/npm/dm/docsearch.js.svg?style=flat-square

View file

@ -1,2 +0,0 @@
[build]
base = "docs"

View file

@ -8,8 +8,8 @@
"build:css": "./scripts/build-css", "build:css": "./scripts/build-css",
"build:js": "./scripts/build-js", "build:js": "./scripts/build-js",
"docs:build": "cd ./docs && yarn build", "docs:build": "cd ./docs && yarn build",
"docs:lint": "cd ./docs && yarn lint",
"docs:serve": "cd ./docs && yarn serve", "docs:serve": "cd ./docs && yarn serve",
"docs:deploy": "cd ./docs && yarn deploy",
"doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md", "doctoc": "doctoc --maxlevel 3 README.md CONTRIBUTING.md",
"lint": "./scripts/lint", "lint": "./scripts/lint",
"release": "./scripts/release", "release": "./scripts/release",

View file

@ -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

View file

@ -8,8 +8,8 @@ then
exit 1 exit 1
fi fi
currentBranch=`git rev-parse --abbrev-ref HEAD` currentBranch=$(git rev-parse --abbrev-ref HEAD)
if [ $currentBranch != 'master' ]; then if [ "$currentBranch" != 'master' ]; then
printf "Release: You must be on master" printf "Release: You must be on master"
exit 1 exit 1
fi fi
@ -26,13 +26,17 @@ git fetch origin --tags
printf "Release: npm install" printf "Release: npm install"
npm install npm install
currentVersion=`cat package.json | json version` currentVersion=$(json version < package.json)
# header # header
printf "\n\nRelease: current version is $currentVersion" echo ""
printf "\nRelease: a changelog will be generated only if a fix/feat/performance/breaking token is found in git log" echo "Release: current version is $currentVersion"
printf "\nRelease: you must choose a new ve.rs.ion (semver)" echo "Release: a changelog will be generated only if a fix/feat/performance/breaking token is found in git log"
printf "\nRelease: press q to exit the next screen\n\n" echo "Release: you must choose a new ve.rs.ion (semver)"
echo "Release: press q to exit the next screen"
echo ""
echo ""
# preview changelog # preview changelog
read -p "=> Release: press [ENTER] to view changes since latest version.." 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 # update changelog
printf "\n\nRelease: 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 conventional-changelog --preset angular --infile CHANGELOG.md --same-file -r 0
# regenerate readme TOC # regenerate readme TOC
@ -60,7 +64,7 @@ npm run doctoc
# git add and tag # git add and tag
commitMessage="v$newVersion\n\n$changelog" commitMessage="v$newVersion\n\n$changelog"
git add src/lib/version.js package.json CHANGELOG.md README.md CONTRIBUTING.md 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" git tag "v$newVersion"
printf "\n\nRelease: almost done, check everything in another terminal tab.\n" printf "\n\nRelease: almost done, check everything in another terminal tab.\n"
@ -71,6 +75,4 @@ git push origin master
git push origin --tags git push origin --tags
npm publish npm publish
printf "Release: printf "Release: Package was published to npm."
Package was published to npm.
A job on travis-ci will be automatically launched to finalize the release."

View file

@ -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