When i am trying to access projects in my google cloud account using
gcloud projects list
always getting the following
+ gcloud projects list
Listed 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?
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?
Pipelines does not currently support line breaks in environment variables, so base-64 encode the private key by running:
$ base64 -w 0 < google-key.json
$ base64 < google-key.json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.