Asked By: Anonymous
I have followed these steps:
- I installed `Google Cloud Build app on Github, linked it to Cloud Build and configured it to use a certain repository (a private one)
- I set up a trigger at Cloud Build:
Push to any branch
- the project has no app instances after deploying (App Engine -> Dashboard)
cloudbuild.yarml looks like this:
steps: - name: 'gcr.io/cloud-builders/gcloud' args: ['app', 'deploy', '--project=project-name', '--version=$SHORT_SHA']
If I try to run the trigger manually: I get this error in Google Cloud:
unable to get credentials for cloud build robot
I have also tried to set IAM roles based on this article but using @cloudbuild.gserviceaccount.com doesn’t seem to be a valid "member" (perhaps I need two projects, one for running and one for building the app?)
How do I fill the gaps / fixes the errors mentioned?
Answered By: Anonymous
It seems the error message looking for credential that has the required permission. From the article that you are following, in the step #4, don’t add manually the Service Account for Cloud Build. Check if you enable the Cloud Build API in your project, if the API is disabled try to enable. It will automatically create the Service Account for Cloud Build and look likes this:
Once the service account is created, go to Cloud Build > Setting page and enable the required roles for you application.