refactor: derive git info inside Docker instead of --build-arg
All checks were successful
check / check (push) Successful in 45s
All checks were successful
check / check (push) Successful in 45s
- Remove .git from .dockerignore so it's available in Docker build context - Install git in Docker image (apt-get) - Remove ARG/ENV GIT_COMMIT_SHORT/FULL from Dockerfile - Remove --build-arg from Makefile docker target - Simplify build.js to use git CLI directly (no env var indirection) build.js already had fallback logic to shell out to git; now that .git is present in the build context, it works directly without needing values passed in from outside Docker.
This commit is contained in:
5
Makefile
5
Makefile
@@ -33,10 +33,7 @@ dev:
|
||||
@yarn run build --watch 2>&1
|
||||
|
||||
docker:
|
||||
@docker build \
|
||||
--build-arg GIT_COMMIT_SHORT=$$(git rev-parse --short HEAD 2>/dev/null || echo unknown) \
|
||||
--build-arg GIT_COMMIT_FULL=$$(git rev-parse HEAD 2>/dev/null || echo unknown) \
|
||||
-t autistmask .
|
||||
@docker build -t autistmask .
|
||||
|
||||
hooks:
|
||||
@echo "Installing pre-commit hook..."
|
||||
|
||||
Reference in New Issue
Block a user