Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Parameterize creds destination file #152

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions gcloud/orb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ commands:
Name of environment variable storing the base64-encoded service key
for the GCP project.
type: env_var_name
creds_dest_file:
default: /key.json
description: >
The path and file where the creds will be stored.
type: string
project:
default: ""
description: The Google project ID to connect with via the gcloud CLI.
Expand All @@ -31,8 +36,8 @@ commands:
description: The Google zone to use via the gcloud CLI.
type: string
steps:
- run: echo "${<<parameters.creds>>}" | base64 -d > /key.json
- run: gcloud auth activate-service-account --key-file=/key.json
- run: echo "${<<parameters.creds>>}" | base64 -d > <<parameters.creds_dest_file>>
- run: gcloud auth activate-service-account --key-file=<<parameters.creds_dest_file>>
- when:
condition: <<parameters.project>>
steps:
Expand Down
Loading