Replace placeholder in Dockerfile

This commit is contained in:
Administrator 2021-06-10 16:13:42 +02:00
parent 3f3de8337c
commit 8908316254
2 changed files with 7 additions and 2 deletions

View File

@ -10,6 +10,10 @@ COPY Webservice Webservice
COPY public public COPY public public
COPY data data COPY data data
RUN sed -i "s/DATE_TO_BE_REPLACED/$(date +%s)/" public/index.html
RUN sed -i "s/COMMIT_TO_BE_REPLACED/GitHub: $(git ls-remote https://github.com/H4CK3R-01/Projektmanagement-Game refs/heads/main | awk '{print $1;}' | cut -c1-7)/" public/index.html
RUN sed -i "s/COMMIT_LINK_TO_BE_REPLACED/https\:\/\/github.com\/H4CK3R-01\/Projektmanagement-Game\/commit\/$(git ls-remote https://github.com/H4CK3R-01/Projektmanagement-Game refs/heads/main | awk '{print $1;}')/" public/index.html
EXPOSE 5000 EXPOSE 5000
CMD [ "node", "Webservice/server.js" ] CMD [ "node", "Webservice/server.js" ]

View File

@ -17,8 +17,9 @@
<body> <body>
<header> <header>
<div></div> <div></div>
<div class="title">Projektmanagement Game</div> <div class="title">PM-Game</div>
<div class="build"><span>DATE_TO_BE_REPLACED</span><span>COMMIT_TO_BE_REPLACED</span></div> <div class="build"><span>DATE_TO_BE_REPLACED</span><span><a href="COMMIT_LINK_TO_BE_REPLACED" target="_blank">COMMIT_TO_BE_REPLACED</a></span>
</div>
</header> </header>
<main> <main>
<div id="login"> <div id="login">