-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for current build command
This lets us easily inspect what version Heimdall has deployed. The number is a link to the Circle build, as well.
- Loading branch information
1 parent
17d595b
commit 18d19a4
Showing
4 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
let fs = require("fs") | ||
|
||
// Description: | ||
// Returns the current deployed build. | ||
// | ||
// Dependencies: | ||
// None | ||
// | ||
// Commands: | ||
// hubot current build | ||
// | ||
// Author: | ||
// shadowfiend | ||
|
||
let buildNumberBuffer = "" | ||
try { | ||
buildNumberBuffer = fs.readFileSync(`${__dirname}/../BUILD`) | ||
} catch (e) { | ||
console.error("Error reading buildNumber file: " + e) | ||
} | ||
let buildNumber = buildNumberBuffer.toString() | ||
|
||
// TODO Announce new build to Bifrost flow, configured. | ||
|
||
module.exports = function (robot) { | ||
robot.respond(/current build/, (response) => | ||
response.send(`I'm on build [${buildNumber}](https://circle-ci.com/gh/cardforcoin/heimdall/${buildNumber})!`)) | ||
} |