0

I am trying to deploy API Gateway on top of cloud functions. For CI/CD I have cloudbuild which is already working smoothly for the project.

I ran gcloud API GATEWAY commands from my local machine and API Gateway deployed successfully.

Now I wrote these commands in cloudbuild.yaml, it is throwing "Internal Server Error" and no further logs on stacktrace.

steps:       
 - name: 'gcr.io/cloud-builders/gcloud'
          id: api
          entrypoint: bash
          args:
            - '-c'
            - |
              gcloud beta api-gateway apis create api --project=project;
    - name: 'gcr.io/cloud-builders/gcloud'
      id: api-config
      waitFor: ['api']
      entrypoint: bash
      args:
        - '-c'
        - |
          gcloud beta api-gateway api-configs create api-config --api=api --openapi-spec=openspec.yaml --project=project --backend-auth-service-account=deployment@project-dev.iam.gserviceaccount.com;
    - name: 'gcr.io/cloud-builders/gcloud'
      id: api-gateway
      waitFor: ['api-config']
      entrypoint: bash
      args:
        - '-c'
        - |
          gcloud beta api-gateway gateways create api-gateway --api=api --api-config=api-config --location=us-central1 --project=project

enter image description here

Is there a way to debug that?

How to deploye my API Gateway using cloudbuild?

openpsec.yaml is a configuration for api gateway as mentioned in the above link.

M-sAnNan
  • 704
  • 8
  • 15
  • Most likely your Cloud Build service account lacks some permissions and the error message is undescriptive due to API Gateway being in beta. Try giving Cloud Build project owner role for a test. – Emil Gi Oct 07 '20 at 13:57
  • there was no permission issue, but that openspec.yaml has a syntax issue that I didn't realize. The issue is fixed. – M-sAnNan Oct 07 '20 at 16:46

0 Answers0