CircleCI-Public / gcp-cli-orb

Install and configure the Google Cloud CLI (gcloud)
https://circleci.com/orbs/registry/orb/circleci/gcp-cli
MIT License
9 stars 32 forks source link

feat!: v3.0.0 - OIDC Support, Install Command Improvements #61

Closed Jaryt closed 1 year ago

Jaryt commented 1 year ago

Checklist

Motivation, issues

Fixes #49 #46 #45 #19

Description

feat: improve version handling

Allows for "latest" option and other improvements to install logic.

refactor!: Replace initialize with setup command

Previously, install and initialize were separate commands, leading to the install_and_initialize job. Using the install_and_initialize job in a workflow creates a situation where post_steps would be needed to utilize gcloud. Since following commands are expected, it's best practice to define a new job as seen in the setup example:

  jobs:
    use-gcp:
      executor: gcp-cli/default
      steps:
        - gcp-cli/setup:
            version: 404.0.0 # optionally pass in the GCP CLI version

All prior functionality of the initialize command is supported in the new setup command. The install command is executed as a step within the setup command, reducing the need to call install as a prerequisite.

feat: OIDC Support

Enable the use_oidc parameter on the setup command to make use of OIDC. Requires an additional environment variable called GOOGLE_PROJECT_NUMBER to be configured. Read more about GCP OIDC here: https://cloud.google.com/identity-platform/docs/web/oidc

feat: Install components

Added optional components parameter to setup and install commands. Space separate component ids to install more than one at a time. See https://cloud.google.com/sdk/docs/components for additional info.

fix: future proof installation url being changed

The install script makes use of https://cloud.google.com/sdk/docs/downloads-versioned-archives to download requested version. For versions > 370, the URL has replaced sdk with cli.

KyleTryon commented 1 year ago

approved