-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
68 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,58 @@ | ||
var Travis = require('travis-ci'); | ||
var repo = "excaliburjs/excaliburjs.github.io"; | ||
var repo = 'excaliburjs/excaliburjs.github.io'; | ||
var travis = new Travis({ | ||
version: '2.0.0', | ||
headers: { | ||
'User-Agent': 'Travis/1.0' | ||
} | ||
version: '2.0.0', | ||
headers: { | ||
'User-Agent': 'Travis/1.0' | ||
} | ||
}); | ||
|
||
var branch = process.env.TRAVIS_BRANCH; | ||
var tag = process.env.TRAVIS_TAG; | ||
var pr = process.env.TRAVIS_PULL_REQUEST; | ||
var pr = process.env.TRAVIS_PULL_REQUEST; | ||
|
||
if (pr !== "false") { | ||
console.log("Skipping docs deployment, detected pull request"); | ||
return; | ||
if (pr !== 'false') { | ||
console.log('Skipping docs deployment, detected pull request'); | ||
return; | ||
} | ||
|
||
// build docs for tags and master only | ||
// build docs for tags and main only | ||
if (tag) { | ||
console.log("Current tag is `" + tag + "`"); | ||
} else if (branch == "master") { | ||
console.log("Current branch is `" + branch + "`"); | ||
console.log('Current tag is `' + tag + '`'); | ||
} else if (branch == 'main') { | ||
console.log('Current branch is `' + branch + '`'); | ||
} else { | ||
console.log("Current branch is `" + branch + "`, skipping docs deployment..."); | ||
return; | ||
console.log('Current branch is `' + branch + '`, skipping docs deployment...'); | ||
return; | ||
} | ||
|
||
console.log("Triggering remote build of edge docs..."); | ||
console.log('Triggering remote build of edge docs...'); | ||
|
||
travis.authenticate({ | ||
github_token: process.env.GH_TOKEN | ||
}, | ||
function (err, res) { | ||
travis.authenticate( | ||
{ | ||
github_token: process.env.GH_TOKEN | ||
}, | ||
function (err, res) { | ||
if (err) { | ||
return console.error(err); | ||
} | ||
|
||
travis.repos(repo.split('/')[0], repo.split('/')[1]).builds.get(function (err, res) { | ||
if (err) { | ||
return console.error(err); | ||
return console.error(err); | ||
} | ||
|
||
travis.repos(repo.split('/')[0], repo.split('/')[1]).builds.get( | ||
function (err, res) { | ||
if (err) { | ||
return console.error(err); | ||
} | ||
|
||
travis.requests.post({ | ||
build_id: res.builds[0].id | ||
}, function (err, res) { | ||
if (err) { | ||
return console.error(err); | ||
} | ||
console.log(res.flash[0].notice); | ||
}); | ||
} | ||
travis.requests.post( | ||
{ | ||
build_id: res.builds[0].id | ||
}, | ||
function (err, res) { | ||
if (err) { | ||
return console.error(err); | ||
} | ||
console.log(res.flash[0].notice); | ||
} | ||
); | ||
} | ||
); | ||
}); | ||
} | ||
); |