Get project ROOT systematically for git and non-git versions of this codebase #304
Open
3 tasks done
Labels
fix/bug
Fixes errant behavior
Affected Branch
trunk
Basic Diagnostics
I've pulled the latest changes on the affected branch and the issue is still present.
The issue is reproducible in docker
Description
If a repo is a git clone, it is easy to get the ROOT with this command:
git rev-parse --show-toplevel
However, this does not work inside a docker image or a non-cloned version of the codebase like unpacking a zip download of it.
Scripts inside the
scripts/*
dir need the ROOT to run, so this should be systematized to work on the codebase whether it is a git clone or docker image or download of the code.In order to reproduce the issue, follow these steps:
Zip download
https://github.com/mit-dci/opencbdc-tx
Docker image
To test on a docker image, I edited the
.dockerignore
andDockerfile
to copy all the scripts to the docker image after runningscripts/build-docker.sh
.After entering creating and entering the docker image, the output is same as the other method above.
This can be solved by scripts calling the output of a short, flexible script that handles finding the project ROOT whether inside a git repository or not.
Sidenote: some of the scripts use git for other purposes such as seeing which files are tracked by
git ls-files
, which will also fail in non-git repos. Example insidescripts/lint.sh
. Fixing that git-reliance can be another issue/PR.Discussed this with @HalosGhost
Code of Conduct
The text was updated successfully, but these errors were encountered: