i don't get it

This commit is contained in:
wukko 2023-04-09 11:38:37 +06:00
parent 81e634b091
commit 80de6a1ebe
2 changed files with 5 additions and 9 deletions

View file

@ -1,17 +1,15 @@
FROM node:18-bullseye-slim
WORKDIR /app
COPY package*.json ./
ARG GIT_COMMIT
ARG GIT_BRANCH
RUN apt-get update
RUN apt-get install -y git
RUN rm -rf /var/lib/apt/lists/*
COPY package*.json ./
RUN npm install
RUN echo $GIT_BRANCH
ENV GIT_BRANCH=$GIT_BRANCH
ENV GIT_COMMIT=$GIT_COMMIT
RUN git clone -n https://github.com/wukko/cobalt.git --depth 1 && mv cobalt/.git ./ && rm -rf cobalt
COPY . .
EXPOSE 9000
CMD [ "node", "src/cobalt" ]

View file

@ -4,7 +4,6 @@ let commit, commitInfo, branch;
export function shortCommit() {
if (commit) return commit;
if (process.env.GIT_COMMIT) return process.env.GIT_COMMIT;
let c = execSync('git rev-parse --short HEAD').toString().trim();
commit = c;
return c
@ -18,7 +17,6 @@ export function getCommitInfo() {
}
export function getCurrentBranch() {
if (branch) return branch;
if (process.env.GIT_BRANCH) return process.env.GIT_BRANCH;
let b = execSync('git branch --show-current').toString().trim();
branch = b;
return b