Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
add submodule & gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartvds committed Jun 26, 2014
1 parent 745bdfe commit 1bac2ea
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "repo"]
path = repo
url = https://github.com/borisyankov/DefinitelyTyped.git
46 changes: 44 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
module.exports = function (grunt) {
'use strict';

function getDeployMessage() {
var ret = '\n\n';
if (process.env.TRAVIS !== 'true') {
ret += 'did not run on travis-ci';
return ret;
}
ret += 'branch: ' + process.env.TRAVIS_BRANCH + '\n';
ret += 'SHA: ' + process.env.TRAVIS_COMMIT + '\n';
ret += 'range SHA: ' + process.env.TRAVIS_COMMIT_RANGE + '\n';
ret += 'build id: ' + process.env.TRAVIS_BUILD_ID + '\n';
ret += 'build number: ' + process.env.TRAVIS_BUILD_NUMBER + '\n';
return ret;
}

var runner = require('./lib/index');

grunt.loadNpmTasks('grunt-contrib-jshint');
Expand All @@ -26,14 +40,42 @@ module.exports = function (grunt) {
'tmp/**/*'
]
}
},
'gh-pages': {
options: {
base: 'docs',
branch: 'gh-pages'
},
publish: {
options: {
repo: 'https://github.com/DefinitelyTyped/docs.git',
message: 'publish (cli)'
},
src: ['**']
},
deploy: {
options: {
repo: 'https://' + process.env.GH_TOKEN + '@github.com/DefinitelyTyped/docs.git',
message: 'publish (auto)' + getDeployMessage(),
silent: true,
user: {
name: 'dt-bot',
email: '[email protected]'
}
},
src: ['**']
}
}
});


grunt.registerTask('exec', function() {
var done = this.async();
runner.bulk('./repo', './tmp', function(dir) {
// return true;
var all = (process.env.TRAVIS !== 'true');
runner.bulk('./repo', './docs', function(dir) {
if (all) {
return /$a/.test(dir) || /$j/.test(dir) || /$node/.test(dir);
}
return /node\.d\.ts$/.test(dir) || /jquery\.d\.ts$/.test(dir);
}).then(function() {
done();
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.5.0",
"grunt-contrib-jshint": "^0.10.0",
"grunt-gh-pages": "^0.9.1",
"jshint-path-reporter": "^0.1.3"
}
}
1 change: 1 addition & 0 deletions repo
Submodule repo added at 87fba9

0 comments on commit 1bac2ea

Please sign in to comment.