Can Selenium and Chrome buildpack installs be cached on HerokuCI? Can Selenium and Chrome buildpack installs be cached on HerokuCI? heroku heroku

Can Selenium and Chrome buildpack installs be cached on HerokuCI?


If you have the caches enabled as described here it does not seem like there is much more you can do to cache the installs. If this is a serious problem you could always point to local packages that you cloned from the remote repos to speed things up.


After various search and try, I bring good news.

The key issue is your errors in log files, like:

bash: /tmp/buildpacks/b5ae60a477f2ba582d00a4ba23348059d40dea69cea6d982947f7c6afa72d2b8d69252449d43cbcf97a23341fd57300a3fef3224ace95482e1c0deaf8a844e4d/export: No such file or directory

This auto-generated directory is obviously a cache directory one, which is generated automatically when not fixed.

Fore instance, this can be confirmed inside the heroku-buildpack-selenium buildpack, defined in your app.json file:

# parse and derive paramsBUILD_DIR=$1CACHE_DIR=$2LP_DIR=`cd $(dirname $0); cd ..; pwd`

It is confirmed by this official documentation I found:

The contents of CACHE_DIR will be persisted between builds. You can cache the results of long processes like dependency resolution here to speed up future builds.

So the key solution is to define this CACHE_DIR variable within your installation; so I guess it is either directly in your app.json file, or directly in your GitHub Hook.

Let me know if you need further help.