Search code examples
gcloudgoogle-container-registrybitbucket-pipelines

gcloud crash while requesting a build (Google Container Builder) from Bitbucket pipelines


We use bitbucket for git repo hosting and started using pipelines for the testing, but now I'm looking at the next step, deployment.

I want to make use of Google Container Builder and trigger this from pipelines. There is a Dockerfile located at kubernetes/nginx/ which should be sent to Google Container Builder.

When I run the following command locally it works perfect:

gcloud container builds submit --tag gcr.io/$PROJECT_ID/website/nginx kubernetes/nginx/

But as part of the pipeline I get the following error:

ERROR: gcloud crashed (AttributeError): 'NoneType' object has no attribute 'replace'

gcloud version:

Google Cloud SDK 143.0.1
bq 2.0.24
bq-nix 2.0.24
core 2017.02.09
core-nix 2017.02.09
gcloud 
gcloud-deps 2017.02.09
gcloud-deps-linux-x86_64 
gsutil 4.22
gsutil-nix 4.22
kubectl 
kubectl-linux-x86_64 1.5.2

Things i've checked:

  • I'm authenticated properly so that isn't the problem.
  • I also verified that the files needed for the build are accessible.

Solution

  • I've added the following commands before the build request:

    gcloud config set compute/zone europe-west1-d
    gcloud config set project *Project id here*
    

    After adding this it worked, so I think the problem was not having access to the zone or project data.