Skip to content

Commit

Permalink
fix docker buld fail due to git info
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo1212 committed Oct 26, 2023
1 parent cd41fd2 commit 1f69d7f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ WORKDIR /usr/src/app

COPY package*.json ./

COPY src/generatedGitInfo.json generatedGitInfo.json

RUN yarn install --frozen-lockfile

# Bundle app source
Expand Down
2 changes: 2 additions & 0 deletions src/components/navigation/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {setGroupDates} from 'util/GroupUtil';
import {VerifyEmail} from './VerifyEmail';
import { useParams } from "react-router-dom";
import generatedGitInfo from 'generatedGitInfo.json';
import { StatusPage } from 'components/status/Status';

const {Header, Content, Footer, Sider} = Layout;

Expand Down Expand Up @@ -164,6 +165,7 @@ const NavigationMenu: React.FC = () => {
element={appRoute.private ?
<ProtectedRoute
component={appRoute.view}/> : appRoute.element}></Route>)}
<Route path='status' element={<StatusPage/>}/>
<Route path='*' element={<NotFoundView/>}/>

</Routes>
Expand Down
11 changes: 11 additions & 0 deletions src/components/status/Status.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Tag } from 'antd'
import generatedGitInfo from 'generatedGitInfo.json';

export const StatusPage = () => {
return <div style={{display: 'flex', flexDirection: 'column'}}>
<div style={{display: 'flex', justifyContent: 'center'}}>
Branch: <Tag>{generatedGitInfo.gitBranch}</Tag>
Git Hash: <Tag>{generatedGitInfo.gitCommitHash}</Tag>
</div>
</div>
}

0 comments on commit 1f69d7f

Please sign in to comment.