-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
804ff08
commit 4e35684
Showing
8 changed files
with
96 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const process = require( "process" ); | ||
const util = require( "../../util" ); | ||
|
||
const index = async req => { | ||
if ( !util.isInternalRequest( req ) ) { | ||
throw util.httpError( 401, "Unauthorized" ); | ||
} | ||
const buildInfoJSON = { | ||
git_branch: process.env.GIT_BRANCH, | ||
git_commit: process.env.GIT_COMMIT, | ||
image_tag: process.env.IMAGE_TAG, | ||
build_date: process.env.BUILD_DATE | ||
}; | ||
return buildInfoJSON; | ||
}; | ||
|
||
module.exports = { | ||
index | ||
}; |
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,34 @@ | ||
const j2s = require( "joi-to-swagger" ); | ||
const BuildInfoController = require( "../../../lib/controllers/v2/build_info_controller" ); | ||
|
||
module.exports = sendWrapper => { | ||
async function GET( req, res ) { | ||
const results = await BuildInfoController.index( req ); | ||
sendWrapper( req, res, null, results ); | ||
} | ||
|
||
GET.apiDoc = { | ||
tags: ["BuildInfo"], | ||
summary: "Display build information", | ||
responses: { | ||
200: { | ||
description: "Build information", | ||
content: { | ||
"application/json": { | ||
schema: { | ||
$ref: "#/components/schemas/BuildInfo" | ||
} | ||
} | ||
} | ||
}, | ||
default: { | ||
$ref: "#/components/responses/Error" | ||
} | ||
}, | ||
"x-unpublished": true | ||
}; | ||
|
||
return { | ||
GET | ||
}; | ||
}; |
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,3 @@ | ||
const Joi = require( "joi" ); | ||
|
||
module.exports = Joi.object( ).keys( {} ); |
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,8 @@ | ||
const Joi = require( "joi" ); | ||
|
||
module.exports = Joi.object( ).keys( { | ||
git_branch: Joi.string( ), | ||
git_commit: Joi.string( ), | ||
image_tag: Joi.string( ), | ||
build_date: Joi.string( ) | ||
} ).unknown( false ); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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