File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export type Bundle = {
2525 resourcefiles : im . Map < string , Resourcefile > ;
2626 schema : any [ ] ;
2727 fileHash : string ;
28+ gitCommit : string ;
2829} ;
2930
3031const getRefPath = ( ref : string ) : string => / ^ [ ^ $ ] * / . exec ( ref ) [ 0 ] ;
@@ -64,6 +65,7 @@ const parseBundle = (contents: string) : Bundle => {
6465 datafiles : parseDatafiles ( parsedContents . data ) ,
6566 resourcefiles : parseResourcefiles ( parsedContents . resources ) ,
6667 fileHash : hashDatafile ( contents ) ,
68+ gitCommit : parsedContents [ 'git_commit' ] ,
6769 schema : parsedContents . graphql ,
6870 } as Bundle ;
6971} ;
@@ -141,6 +143,7 @@ export const bundleFromEnvironment = async() => {
141143 resourcefiles : im . Map < string , Resourcefile > ( ) ,
142144 schema : { } ,
143145 fileHash : '' ,
146+ gitCommit : '' ,
144147 } as Bundle ;
145148 }
146149} ;
Original file line number Diff line number Diff line change @@ -137,6 +137,11 @@ export const appFromBundle = async (bundle: Promise<db.Bundle>) => {
137137 res . send ( hash ) ;
138138 } ) ;
139139
140+ app . get ( '/git-commit' , ( req : express . Request , res : express . Response ) => {
141+ const git_commit = req . app . get ( 'bundle' ) . gitCommit ;
142+ res . send ( git_commit ) ;
143+ } ) ;
144+
140145 app . get ( '/metrics' , ( req : express . Request , res : express . Response ) => {
141146 res . send ( promClient . register . metrics ( ) ) ;
142147 } ) ;
You can’t perform that action at this time.
0 commit comments