Skip to content

Commit

Permalink
Build docs on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Jan 3, 2016
1 parent 3dfb4a2 commit 2376391
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
coverage/
tmp/
tmp/
docs/
4 changes: 2 additions & 2 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"excludeFiles": ["node_modules/**", "coverage/**", "tmp/**"],
"excludeFiles": ["node_modules/**", "coverage/**", "tmp/**", "docs/**"],
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
Expand Down Expand Up @@ -82,4 +82,4 @@
"validateNewlineAfterArrayElements": true,
"validateParameterSeparator": ", ",
"disallowMultipleSpaces": true
}
}
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ script:

after_script:
- npm install coveralls
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

deploy:
provider: script
script: .travis/deploy.sh
skip_cleanup: true
on:
branch: master
20 changes: 20 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Decrypt the private key
openssl aes-256-cbc -K $encrypted_a808e857cd51_key -iv $encrypted_a808e857cd51_iv -in .travis/ssh_key.enc -out ~/.ssh/id_rsa -d
# Set the permission of the key
chmod 600 ~/.ssh/id_rsa
# Start SSH agent
eval $(ssh-agent)
# Add the private key to the system
ssh-add ~/.ssh/id_rsa
# Copy SSH config
cp .travis/ssh_config ~/.ssh/config
# Set Git config
git config --global user.name "Tommy Chen"
git config --global user.email tommy351@gmail.com
# Clone the repository
git clone git@github.com:tommy351/warehouse.git --branch gh-pages docs
# Generate JSDoc
npm run jsdoc
# Push to GitHub
cd docs && git push
5 changes: 5 additions & 0 deletions .travis/ssh_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Host github.com
User git
StrictHostKeyChecking no
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
Binary file added .travis/ssh_key.enc
Binary file not shown.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
## Installation

``` bash
$ npm install warehouse
$ npm install warehouse
```

## Usage

``` js
var Database = require('warehouse');
var db = new Database();

var Post = db.model('posts', {
title: String,
created: {type: Date, default: Date.now}
Expand All @@ -26,10 +26,10 @@ Post.insert({
});
```

- [API](http://hexo.io/api/warehouse/classes/Database.html)
- [API](http://tommy351.github.io/warehouse/)

## Test

``` bash
$ gulp test
```
```
1 change: 1 addition & 0 deletions lib/schematype.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ SchemaType.prototype.q$lt = function(value, query, data) {
SchemaType.prototype.q$lte = function(value, query, data) {
return value <= query;
};

SchemaType.prototype.q$max = SchemaType.prototype.q$lte;

/**
Expand Down
1 change: 0 additions & 1 deletion lib/types/array.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ SchemaTypeArray.prototype.u$unshift = function(value, update, data) {
return [update];
};


SchemaTypeArray.prototype.u$prepend = SchemaTypeArray.prototype.u$unshift;

/**
Expand Down

0 comments on commit 2376391

Please sign in to comment.