Skip to content

Commit

Permalink
Merge pull request #1305 from tgriesser/feature/gh-pages-script
Browse files Browse the repository at this point in the history
gh-pages and postrelease script
  • Loading branch information
rhys-vdw committed Jun 29, 2016
2 parents ab426d9 + b497ce0 commit a81945a
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 88 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
@@ -1,6 +1,10 @@
# .travis.yml
language: node_js

services:
- postgresql
- mysql

sudo: false

node_js:
Expand Down
7 changes: 5 additions & 2 deletions package.json
Expand Up @@ -9,8 +9,11 @@
"build": "babel -q -L -D ./src/ --out-dir ./lib/",
"lint": "eslint bookshelf.js src/",
"cover": "npm run lint && istanbul cover _mocha -- --check-leaks -t 5000 -b -R spec test/index.js",
"test": "npm run lint && npm run build && mocha --check-leaks -t 5000 -b test/index.js",
"jsdoc": "./scripts/jsdoc.sh"
"test": "npm run lint && mocha --check-leaks -t 5000 -b test/index.js",
"jsdoc": "./scripts/jsdoc.sh",
"gh-pages": "./scripts/gh-pages.sh",
"prepublish": "npm run build",
"postpublish": "npm run gh-pages"
},
"homepage": "http://bookshelfjs.org",
"repository": {
Expand Down
19 changes: 19 additions & 0 deletions scripts/gh-pages.sh
@@ -0,0 +1,19 @@
#!/bin/bash -e

# Checkout and update gh-pages branch.
git checkout -B gh-pages origin/gh-pages

# Update to master.
git pull origin master

# Regenate documentation.
npm run jsdoc

# We must force add because these are usually ignored.
git add --force --all index.html docs

# Commit changes.
git commit -m "Update docs"

# Push the update.
git push origin gh-pages
13 changes: 13 additions & 0 deletions scripts/postpublish.sh
@@ -0,0 +1,13 @@
#!/bin/bash -e

get_property() {
echo $(node -p "p=require('./${1}').${2};")
}

version="$(get_property 'package.json' 'version')"

git commit -am "Release $version"
git tag $version

git push origin master
git push origin master --tags
86 changes: 0 additions & 86 deletions scripts/release.sh

This file was deleted.

0 comments on commit a81945a

Please sign in to comment.