Skip to content

Instantly share code, notes, and snippets.

Last active September 29, 2021 09:20
What would you like to do?
CircleCi config for homebrew
version: 2
working_directory: ~/repo
machine: true
- checkout
# Install Linuxbrew Dependencies Via Apt
- run:
name: Install Dependencies
command: |
sudo apt-get install build-essential python-dev curl file git python-setuptools ruby
# Install Linuxbrew (Note: Adding linuxbrew to the PATH here won't work since each run command runs in its
# own shell. The parent shell (the one that calls each run command) is not affected. We add `yes |` to
# tell linuxbrew to continue installing. We add `|| true` to override the linuxbrew install returning exit
# code 141. There may be a bug in the install of linuxbrew via a password where it returns 141 on a warning
# rather than on an error.)
- run:
name: Install Linuxbrew
command: |
yes | ruby -e "$(curl -fsSL" || true
# Install Custom Linuxbrew Formulae (Note: Since the parent shell can't be given the path to linuxbrew we
# have to add it to the path within the same run command (child shell).)
- run:
name: Install Custom Formulae
command: |
export PATH="$HOME/.linuxbrew/bin:$PATH"
brew install ./easel.rb
# Run Linuxbrew Tests
- run:
name: Test Custom Formulae
command: |
export PATH="$HOME/.linuxbrew/bin:$PATH"
brew test ./easel.rb
Copy link

@LeeBergstrand Thanks for sharing! I've used $BASH_ENV to set $PATH once. E.g. something like the following could work here:

      - run:
          name: Setup PATH
          command: |
            echo 'export PATH=$HOME/.linuxbrew/bin:$PATH' >> $BASH_ENV

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment