The `build` script does nothing when called from outside it's directory
The build
script does not find it's required files when we run the command from the target directory.
Steps to reproduce
- create a project hierarchy to simulate multi-environments
~# mkdir -p /tmp/my-project/{prod,dev,staging}
- move to that directory
~# cd /tmp/my-project/
- get the tools utilities
/tmp/my-project# git clone https://gitlab.mim-libre.fr/EOLE/eole-3/tools.git
- configure the
dev
environment/tmp/my-project# cd /tmp/my-project/dev /tmp/my-project/dev# cp ../tools/vars.ini .
- generate the base application deployment
/tmp/my-project/dev# /tmp/my-project/tools/build -c /tmp/my-project/dev/vars.ini gen-socle Usage: build [OPTIONS] COMMAND [ARGS]... Try 'build --help' for help. Error: Invalid value for '-cc' / '--clusterconfigfile': Path 'cluster-vars.ini' does not exist.
- configure the
cluster-vars.ini
fordev
/tmp/my-project/dev# cp ../tools/cluster-vars.ini . /tmp/my-project/dev# /tmp/my-project/tools/build -c /tmp/my-project/dev/vars.ini gen-socle /tmp/my-project/dev#
Proposed solutions
I think the build
script should search for it's files in it's own directory:
- the
templates/
must be searched relatives to thebuild
directory - the
vars.ini
andcluster-vars.ini
- may be kept the current way, when a user move in another directory, the tool will use the ones in the current directory
- may be search in the
build
directory and users are forced to use--configfile
and--clusterconfigfile