Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

gcloud projects list is always empty

When i am trying to access projects in my google cloud account using 

gcloud projects list

always getting the following

+ gcloud projects listListed 0 items. 

So I can't complete the steps  - and i can't set the project 

and in this step

gcloud config set project $MY_PROJECT

I got 

+ gcloud config set project #My_PROJECT Updated property [core/project].
WARNING: You do not appear to have access to project [#My_PROJECT] or it does not exist.

The following is steps in my pipeline

- step:
name: Test google auth
image: google/cloud-sdk:latest
script:
- echo $KEY_FILE | base64 --decode --ignore-garbage > ~/google-key.json
- gcloud auth activate-service-account --key-file ~/google-key.json
- gcloud projects list
- gcloud config set project $MY_PROJECT
- gcloud container clusters get-credentials $MY_CLUSTER --region $REGION
services:
- docker

- Is there any missing steps? or prerequists to link bitbucket to my google account?

2 answers

1 accepted

0 votes
Answer accepted

If you successfully activate the service account as follows:

gcloud auth activate-service-account --key-file service-account-key.json

and you can see it as the ACTIVE one after executing the following:

gcloud auth list

and still, get ZERO items

Listed 0 items.

after executing the following:

gcloud projects list

THEN

Try to add your service account as a member of your Organization beside the project and assign it a Viewer role.

Hi @HosamEmam ,

Thank you for the feedback!

Have you encoded and configured a $KEY_FILE properly?

Encode the private key

Pipelines does not currently support line breaks in environment variables, so base-64 encode the private key by running:

LINUX

$ base64 -w 0 < google-key.json

MAC OS X
$ base64 < google-key.json

It is encoded well as after decoding, I tried to read the result and found it correct, i encoded using windows - as the following example

certutil -encode data.txt tmp.b64 && findstr /v /c:- tmp.b64 > data.b64

 And i tried it without encoding just plain text and the same issue

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

Announcing the waitlist for Jira Work Management

Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...

895 views 14 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you