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

Commit 1bac2ea

Browse files
committed
add submodule & gh-pages
1 parent 745bdfe commit 1bac2ea

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "repo"]
2+
path = repo
3+
url = https://github.com/borisyankov/DefinitelyTyped.git

Gruntfile.js

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
module.exports = function (grunt) {
22
'use strict';
33

4+
function getDeployMessage() {
5+
var ret = '\n\n';
6+
if (process.env.TRAVIS !== 'true') {
7+
ret += 'did not run on travis-ci';
8+
return ret;
9+
}
10+
ret += 'branch: ' + process.env.TRAVIS_BRANCH + '\n';
11+
ret += 'SHA: ' + process.env.TRAVIS_COMMIT + '\n';
12+
ret += 'range SHA: ' + process.env.TRAVIS_COMMIT_RANGE + '\n';
13+
ret += 'build id: ' + process.env.TRAVIS_BUILD_ID + '\n';
14+
ret += 'build number: ' + process.env.TRAVIS_BUILD_NUMBER + '\n';
15+
return ret;
16+
}
17+
418
var runner = require('./lib/index');
519

620
grunt.loadNpmTasks('grunt-contrib-jshint');
@@ -26,14 +40,42 @@ module.exports = function (grunt) {
2640
'tmp/**/*'
2741
]
2842
}
43+
},
44+
'gh-pages': {
45+
options: {
46+
base: 'docs',
47+
branch: 'gh-pages'
48+
},
49+
publish: {
50+
options: {
51+
repo: 'https://github.com/DefinitelyTyped/docs.git',
52+
message: 'publish (cli)'
53+
},
54+
src: ['**']
55+
},
56+
deploy: {
57+
options: {
58+
repo: 'https://' + process.env.GH_TOKEN + '@github.com/DefinitelyTyped/docs.git',
59+
message: 'publish (auto)' + getDeployMessage(),
60+
silent: true,
61+
user: {
62+
name: 'dt-bot',
63+
64+
}
65+
},
66+
src: ['**']
67+
}
2968
}
3069
});
3170

3271

3372
grunt.registerTask('exec', function() {
3473
var done = this.async();
35-
runner.bulk('./repo', './tmp', function(dir) {
36-
// return true;
74+
var all = (process.env.TRAVIS !== 'true');
75+
runner.bulk('./repo', './docs', function(dir) {
76+
if (all) {
77+
return /$a/.test(dir) || /$j/.test(dir) || /$node/.test(dir);
78+
}
3779
return /node\.d\.ts$/.test(dir) || /jquery\.d\.ts$/.test(dir);
3880
}).then(function() {
3981
done();

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"grunt": "^0.4.5",
5151
"grunt-contrib-clean": "^0.5.0",
5252
"grunt-contrib-jshint": "^0.10.0",
53+
"grunt-gh-pages": "^0.9.1",
5354
"jshint-path-reporter": "^0.1.3"
5455
}
5556
}

repo

Submodule repo added at 87fba9f

0 commit comments

Comments
 (0)