Conversation
|
This I could have just added the before_install:
- git clone https://example.com/repo/app-a
- git clone https://example.com/repo/app-b
- git clone https://example.com/repo/app-c
before_script:
- export PATH="${HOME}/app-a/bin:${PATH}"
- export PATH="${HOME}/app-b/bin:${PATH}"
- export PATH="${HOME}/app-c/bin:${PATH}"So I decided to install such dependencies with the prefix before_install:
- ./script/install-app-a.sh
- ./script/install-app-b.sh
- ./script/install-app-c.sh
before_script:
- export PATH="${HOME}/.local/bin:${PATH}"I also put the install logic into a shell script (as recommended for complex commands such as installing software from source or implementing complex build steps) to keep If I need to add a dependency that I have already used in another project, I just have to copy the install script and add it in Obviously the more source built dependencies a project uses the more benefit this approach has. And installing, copying usually just a few files, has very little overhead comparing to downloading, building, and testing the project. It's a tiny bit of overhead for a tiny bit of convenience. Not everybody may like it or think it worths the hassle. I haven't had that many projects to actually see the real benefit of sharing yet. I just happened to use it elsewhere and used it here as well. I'm open to changing this with your patch if you still think that's better. :) Advantages:
Disadvantages:
|
I don't think there's much value in running the bats install script. Rather, bats can just be cloned and executed from the clone. Indeed, this is what most of the rbenv projects do when running on travis.
This also (marginally) speeds up the test suite since there is no need to run the bats install script or remove the one-time-use clone.