gitlab-ci-local icon indicating copy to clipboard operation
gitlab-ci-local copied to clipboard

Decouple from cwd

Open avoidik opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I would like to keep all gitlab-ci-local related data outside of my git projects, completely separate. Which seems to be an impossible goal due to the common pattern to bind almost all path operations to the cwd (${cwd}/${stateDir}/..., ${cwd}/${file}, git, etc.).

Describe the solution you'd like

I would like to have an option to be able to decouple from the cwd. The idea here is that GCL should take only a source code from the particular directory I could have specified, while everything else, like dotfiles, variables.yaml, stateDir, even gitlab-ci-local.yml itself, sits in another directory, outside of a git project. Something like --git-dir CLI option, maybe.

Describe alternatives you've considered

I was trying to combine different CLI options (--home, --state-dir, --cwd, --file) in attempt to achieve what I want, but I was unable to do so.

Additional context

N/A

avoidik avatar Dec 29 '23 10:12 avoidik

We could implement code that allows --state-dir to be an absolute path...

Would that be sufficient for your use case?

gitlab-ci-local --state-dir /home/me/project35-gitlab-ci-local

firecow avatar Dec 29 '23 17:12 firecow

It looks good to me, I guess if we are going to follow this pattern the --file CLI should be also able to accept absolute path.

avoidik avatar Dec 29 '23 18:12 avoidik