Can I use Homebrew?
Platform.sh DevRel
I’m used to using Homebrew as my package manager - can I use it on Platform.sh?
0
Comments
You can run the installer during your build hook using the install script for Linux in that repository.
Modify your build hook to include:
Since
sudois not available on Platform.sh, the installer places Homebrew in a.linuxbrewdirectory withinapp. Theevallines export a set of environment variables specific to Homebrew to the environment and to a local.profile(so thatbrewcan be run during SSH).Homebrew has changed their install.sh file so these instructions no longer work. However… there is an alternative way of installing straight from the tarball which does work
I’ve spent some time cleaning up some code and making a simple bash script that can be used to simply install one or more brew packages.
Create a file called
install_brew_packages.shwith the following contents into the root of your project (where your.platform.app.yamllives).``You can then call the script in the build hook. The script takes 1 or more arguments. Simply specify the packages you want to install.
Building from source with brew is rather slow, but the script will automatically use the cache folder. This will ensure that the subsequent builds are fast.
To install
dufandlnavyou can do this in the build hook:Full source can be found here as well https://github.com/matthiaz/platformsh-tools#install_brew_packagessh
I’ve tried this as I need to install gdal library but I get brew not found when I try and install my package in the build hook.
When I ssh in brew is not available,
Please sign in to leave a comment.