-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: v3.0.0 - OIDC Support, Install Command Improvements (#61)
Co-authored-by: Eric Ribeiro <ericribeiro@outlook.com.br>
- Loading branch information
1 parent
1d50867
commit 67e4448
Showing
12 changed files
with
413 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
description: | | ||
Install and initialize the gcloud CLI. When installing within the Docker executor, the | ||
install will only occur if the CLI isn't already installed. If installing in | ||
a Linux machine image, it will remove the pre_installed version and instead | ||
install the version specified by this orb. | ||
parameters: | ||
version: | ||
type: string | ||
default: "latest" | ||
description: > | ||
The version of the gcloud CLI to install. | ||
If left to "latest", the latest version will be installed. | ||
Otherwise, provide the full version number as it appears in the URL on this page: https://cloud.google.com/sdk/docs/downloads-versioned-archives | ||
components: | ||
type: string | ||
default: "" | ||
description: > | ||
The list of gcloud components to install. Space separated. | ||
See https://cloud.google.com/sdk/docs/components for additional info. | ||
gcloud_service_key: | ||
type: env_var_name | ||
default: GCLOUD_SERVICE_KEY | ||
description: | | ||
Name of environment variable storing the full service key JSON file | ||
for the Google project. | ||
google_project_id: | ||
type: env_var_name | ||
default: GOOGLE_PROJECT_ID | ||
description: | | ||
Name of environment variable storing the Google project ID to set as | ||
default for the gcloud CLI. | ||
google_compute_zone: | ||
type: env_var_name | ||
default: GOOGLE_COMPUTE_ZONE | ||
description: | | ||
Name of environment variable storing the Google compute zone to set as | ||
default for the gcloud CLI. | ||
google_compute_region: | ||
type: env_var_name | ||
default: GOOGLE_COMPUTE_REGION | ||
description: | | ||
Name of environment variable storing the Google compute region to set as | ||
default for the gcloud CLI. | ||
# OIDC parameters | ||
|
||
use_oidc: | ||
type: boolean | ||
default: false | ||
description: Set to true to enable OIDC | ||
|
||
google_project_number: | ||
type: env_var_name | ||
default: GOOGLE_PROJECT_NUMBER | ||
description: | | ||
Name of environment variable storing the Google project number | ||
used to configure OIDC. | ||
workload_identity_pool_id: | ||
type: env_var_name | ||
default: OIDC_WIP_ID | ||
description: | | ||
Environment variable containing OIDC configured workload identity pool is stored. | ||
workload_identity_pool_provider_id: | ||
type: env_var_name | ||
default: OIDC_WIP_PROVIDER_ID | ||
description: | | ||
Environment variable containing OIDC configured workload identity pool provider ID is stored. | ||
service_account_email: | ||
type: env_var_name | ||
default: OIDC_SERVICE_ACCOUNT_EMAIL | ||
description: Environment variable containing OIDC service account email. | ||
|
||
gcp_cred_config_file_path: | ||
type: string | ||
default: ~/gcp_cred_config.json | ||
description: Output location of OIDC credentials. | ||
|
||
steps: | ||
- install: | ||
version: << parameters.version >> | ||
components: << parameters.components >> | ||
- run: | ||
name: Initialize gcloud CLI to connect to Google Cloud | ||
environment: | ||
ORB_ENV_SERVICE_KEY: <<parameters.gcloud_service_key>> | ||
ORB_ENV_PROJECT_ID: <<parameters.google_project_id>> | ||
ORB_ENV_COMPUTE_ZONE: <<parameters.google_compute_zone>> | ||
ORB_ENV_COMPUTE_REGION: <<parameters.google_compute_region>> | ||
# OIDC | ||
ORB_VAL_USE_OIDC: <<parameters.use_oidc>> | ||
ORB_ENV_PROJECT_NUMBER: <<parameters.google_project_number>> | ||
ORB_EVAL_CRED_FILE: <<parameters.gcp_cred_config_file_path>> | ||
ORB_ENV_POOL_ID: <<parameters.workload_identity_pool_id>> | ||
ORB_ENV_POOL_PROVIDER_ID: <<parameters.workload_identity_pool_provider_id>> | ||
ORB_ENV_SERVICE_EMAIL: <<parameters.service_account_email>> | ||
command: << include(scripts/setup.sh) >> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
description: Install and initalize the gcloud CLI. | ||
|
||
usage: | ||
version: 2.1 | ||
|
||
orbs: | ||
gcp-cli: circleci/gcp-cli@2.4.1 | ||
|
||
jobs: | ||
use-gcp: | ||
executor: gcp-cli/default | ||
steps: | ||
- gcp-cli/setup: | ||
version: 404.0.0 | ||
|
||
workflows: | ||
install_and_configure_cli: | ||
jobs: | ||
- use-gcp: # optionally pass in the GCP CLI version | ||
context: myContext # store your gCloud service key via Contexts, or project-level environment variables |
Oops, something went wrong.