Skip to content

Commit

Permalink
Merge pull request #108 from zhiyan114/master
Browse files Browse the repository at this point in the history
Load from loader.js instead of index.js
  • Loading branch information
zhiyan114 authored May 16, 2024
2 parents 31eddc8 + 150b0d3 commit 2ca2279
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ COPY --from=buildenv /source/commitHash /app/commitHash
# Exposed web server port
EXPOSE ${WEBSERVER_PORT}

CMD node index.js
CMD node loader.js
5 changes: 2 additions & 3 deletions src/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import {existsSync, readFileSync} from "fs";
if(process.env["COMMITHASH"] === undefined) {
// Try to load the commit hash via file
if(existsSync("commitHash")) {
const hash = readFileSync("commitHash").toString();
console.log(`Commit hash file found, loading: ${hash}`);
process.env["COMMITHASH"] = hash;
console.log(`Loading commit from file...`);
process.env["COMMITHASH"] = readFileSync("commitHash").toString();
}
else
console.warn("No commit hash found!");
Expand Down

0 comments on commit 2ca2279

Please sign in to comment.