How do I install Homebrew through the command config?

0

Hi! I'm just getting started with Beanstalk so apologies if this is a trivial question. I'm trying to install Homebrew onto my Beanstalk application's instances, and I've unsuccessfully been trying to install Homebrew using a custom Linux command in a .config file.

I'm using the online reference here (https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-commands) and I'm trying to install Homebrew with the command described here (https://brew.sh/).

Here is my homebrew.config file:

commands:
install_homebrew:
command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

The error I'm getting is:

2020-08-10 04:09:35 ERROR [Instance: i-096f98d15abfff217] Command failed on instance. Return code: 127 Output: /bin/bash: line 31: HOME: unbound variable.

And the offending line is:

HOMEBREW_CACHE="${HOME}/.cache/Homebrew"

I'm confused because I thought every Linux instance by default will have the HOME variable set. How can I get variables like HOME to be automatically set for Beanstalk .config commands?

Edited by: hardcode on Aug 11, 2020 12:00 AM

Edited by: hardcode on Aug 12, 2020 11:25 AM

gefragt vor 4 Jahren902 Aufrufe
2 Antworten
0

Decided to just use an AMI.

beantwortet vor 4 Jahren
0

Could maybe try bash -lc to ensure it's a login shell.

https://qiita.com/ymm1x/items/8eba92e15420715e9a2f also has an example of how to check what's exported for your beanstalk platform. Not sure, but it might vary a little between platforms.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen