We are testing Google Cloud Repositories with Google Cloud Build.
We created a basic cloudbuild.yaml and the build itself is started (we are using Go).
Our Go Programm has some imports that are in the same repository (which is hosted on Google Cloud Repositories) e.g:
- src/repository
- main.go (has import source.developers.com/repository/subpackage)
- subpackage/
in the package itself we have the import path over source.developers.google.com. When Go attempts to clone the repository (when running go get, it fails due to missing credentials:
Step #0: Cloning into '/workspace/gopath/src/source.developers.google.com/ourrepository'...
Step #0: fatal: could not read Username for
'https://source.developers.google.com': terminal prompts disabled
Step #0: package source.developers.google.com/subpackage: exit status 128 [...]ERROR: build step 0 "gcr.io/cloud-builders/go" failed: exit status 1
The cloud build account already has access to the repository and is allowed to clone it.
How can we clone the repository with Google Build?