Skip to content

Commit

Permalink
feat: Make creds destination file parameterized
Browse files Browse the repository at this point in the history
  • Loading branch information
cphoward committed Jun 21, 2024
1 parent 7921365 commit 2a60424
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit 2a60424

Please sign in to comment.