How to install the gcloud CLI on macOS executors

Introduction:

This article guides you through installing the Google Cloud CLI (gcloud), included in the Google Cloud SDK, on macOS executors used in CircleCI. This tool is not preinstalled on macOS images by default, but users can manually install it using Google’s official instructions or via Homebrew for simplicity. This guide will walk through the easiest and most reliable method using Homebrew.

  • A CircleCI project using a macOS executor.
  • Homebrew is preinstalled on all CircleCI macOS images.

Instructions:

  1. Choose the install method
    • While Google provides manual installation instructions here, most users find Homebrew easier.

       
  2. Install gcloud using Homebrew

    - run:
        name: "Install gcloud CLI"
        command: "brew update && brew install --cask google-cloud-sdk"
    
  3. Verify installation
    • After install, you can verify with:

      gcloud --version
      
  4. Locate the installed binary
    • Installed at: /opt/homebrew/bin/gcloud
    • This path is included in $PATH by default on macOS executors.

Outcome:

The gcloud CLI will be installed and available on your macOS executor, allowing your jobs to authenticate, configure, or deploy to Google Cloud resources as needed.

Additional Resources:

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.