doubaran2438 2019-09-13 00:01
浏览 102

如何在使用Go模块的GCP Standard App部署中使用私有VSTS存储库?

I am currently trying to deploy a GCP standard app service written in Go. This week I tried to move our code base from Govendor (and using a vendor folder entirely) to Go Modules. The problem is we use a private repository for some of our package dependencies.

My local builds are fine. I can get our Jenkins build to run by setting credentials. But I have no idea how to add either SSH or PAT based authentication to the cloud build that deploying my service kicks off.

I have a go.mod file for each service with content similar to this:

module module.repo.com/module

require (
    module.repo.com/shared v1.0.0
    module.repo.com/mocks v1.0.0
    github.com/fatih/structs v1.1.0
    github.com/gorilla/mux v1.7.3
    golang.org/x/net v0.0.0-20190909003024-a7b16738d86b
    google.golang.org/appengine v1.6.2
    organization-swt.visualstudio.com/PROJECT/GROUP-domain v0.0.0-20190904164039-f21f29fd26c8
)

replace module.repo.com/shared=> ./shared

replace module.repo.com/mocks => ./mocks

replace organization-swt.visualstudio.com/PROJECT/GROUP-domain => organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git v0.0.0-20190904164039-f21f29fd26c8

For each service we run: gcloud app deploy --project ${params.DEPLOY_TO} --version=v${env.BUILD_NUMBER} --verbosity=debug ./ui/web/app.yaml ${backEnds} dispatch.yaml

This is where things run into trouble. The deployment goes fine up until the cloud build step.

starting build "***"

FETCHSOURCE
BUILD
Starting Step #0 - "fetcher"
Step #0 - "fetcher": Already have image (with digest): gcr.io/cloud-builders/gcs-fetcher
Step #0 - "fetcher": Fetching manifest gs://***.appspot.com/ae/***/manifest.json.
Step #0 - "fetcher": Processing 62 files.
Step #0 - "fetcher": ******************************************************
Step #0 - "fetcher": Status: SUCCESS
Step #0 - "fetcher": Started: 2019-09-12T22:50:21Z
Step #0 - "fetcher": Completed: 2019-09-12T22:50:21Z
Step #0 - "fetcher": Requested workers: 200
Step #0 - "fetcher": Actual workers: 62
Step #0 - "fetcher": Total files: 62
Step #0 - "fetcher": Total retries: 0
Step #0 - "fetcher": GCS timeouts: 0
Step #0 - "fetcher": MiB downloaded: 0.35 MiB
Step #0 - "fetcher": MiB/s throughput: 1.46 MiB/s
Step #0 - "fetcher": Time for manifest: 168.61 ms
Step #0 - "fetcher": Total time: 0.42 s
Step #0 - "fetcher": ******************************************************
Finished Step #0 - "fetcher"
Starting Step #1 - "builder"
Step #1 - "builder": Pulling image: gcr.io/gae-runtimes/go111_app_builder:go111_20190827_1_11_12_RC00
Step #1 - "builder": go111_20190827_1_11_12_RC00: Pulling from gae-runtimes/go111_app_builder
Step #1 - "builder": Digest: ***
Step #1 - "builder": Status: Downloaded newer image for gcr.io/gae-runtimes/go111_app_builder:go111_20190827_1_11_12_RC00
Step #1 - "builder": gcr.io/gae-runtimes/go111_app_builder:go111_20190827_1_11_12_RC00
Step #1 - "builder": 2019/09/12 22:50:23 Starting commonbuild with args [commonbuild --runtime=go111 --entrypoint= --src=/workspace --config-file=/.googleconfig/app_start.json --main= -- build --name=us.gcr.io/***/app-engine-tmp/app/ttl-2h:*** --directory=/workspace --destination=/srv --additional-directory=/.googleconfig --base=us.gcr.io/gae-runtimes/go111:go111_20190827_1_11_12_RC00 --main=].
Step #1 - "builder": 2019/09/12 22:50:23 No start command generator found for go111, using default app start command "serve".
Step #1 - "builder": 2019/09/12 22:50:23 Writing configuration file "/.googleconfig/app_start.json".
Step #1 - "builder": 2019/09/12 22:50:23 Invoking build command "build --name=us.gcr.io/***/app-engine-tmp/app/ttl-2h:*** --directory=/workspace --destination=/srv --additional-directory=/.googleconfig --base=us.gcr.io/gae-runtimes/go111:go111_20190827_1_11_12_RC00 --main=".
Step #1 - "builder": 2019/09/12 22:50:23 Building /tmp/staging589718210/srv, with main package at ./web, saving to /tmp/staging589718210/usr/local/bin/start
Step #1 - "builder": 2019/09/12 22:50:23 Running &{/usr/local/go/bin/go [go build -o /tmp/staging589718210/usr/local/bin/start ./web] [PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=*** HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GO111MODULE=on GOCACHE=/tmp/cache495806777 GOPATH=/go] /tmp/staging589718210/srv <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}
Step #1 - "builder": 2019/09/12 22:59:13 Wrote build output to /builder/outputs/output
Step #1 - "builder": 2019/09/12 22:59:13 Failed to build app: [go build -o /tmp/staging589718210/usr/local/bin/start ./web] with env [PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=*** HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GO111MODULE=on GOCACHE=/tmp/cache495806777 GOPATH=/go] failed: err=exit status 1, out="go: finding github.com/go-openapi/runtime v0.19.5
go: finding github.com/gorilla/mux v1.7.3
go: finding github.com/go-openapi/strfmt v0.19.3
go: finding golang.org/x/tools v0.0.0-20190617190820-da514acc4774
go: finding golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56
go: finding golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
go: finding google.golang.org/api v0.10.0
go: finding google.golang.org/appengine v1.6.2
go: finding github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
go: finding github.com/go-stack/stack v1.8.0
go: finding github.com/mitchellh/mapstructure v1.1.2
go: finding github.com/go-openapi/analysis v0.19.5
go: finding go.mongodb.org/mongo-driver v1.0.3
go: finding github.com/go-openapi/swag v0.19.5
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding google.golang.org/appengine v1.4.0
go: finding github.com/golang/protobuf v1.3.1
go: finding go.mongodb.org/mongo-driver v1.1.1
go: finding cloud.google.com/go v0.34.0
go: finding github.com/stretchr/testify v1.3.0
go: finding github.com/tidwall/pretty v1.0.0
go: finding golang.org/x/text v0.3.2
go: finding github.com/google/uuid v1.1.1
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/docker/go-units v0.4.0
go: finding github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63
go: finding github.com/kr/pretty v0.1.0
go: finding golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: finding golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
go: finding golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding github.com/kr/text v0.1.0
go: finding github.com/google/go-cmp v0.3.0
go: finding github.com/go-openapi/spec v0.19.3
go: finding golang.org/x/net v0.0.0-20190603091049-60506f45cf65
go: finding github.com/golang/protobuf v1.2.0
go: finding github.com/hashicorp/golang-lru v0.5.1
go: finding github.com/googleapis/gax-go/v2 v2.0.5
go: finding google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
go: finding golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59
go: finding github.com/stretchr/objx v0.2.0
go: finding golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
go: finding github.com/go-openapi/loads v0.19.3
go: finding golang.org/x/sys v0.0.0-20190606165138-5da285871e9c
go: finding golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
go: finding cloud.google.com/go v0.38.0
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding github.com/google/martian v2.1.0+incompatible
go: finding github.com/stretchr/objx v0.1.0
go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go: finding golang.org/x/lint v0.0.0-20190409202823-959b441ac422
go: finding github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding github.com/golang/mock v1.2.0
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding google.golang.org/api v0.4.0
go: finding google.golang.org/appengine v1.5.0
go: finding golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
go: finding golang.org/x/text v0.3.0
go: finding github.com/go-openapi/errors v0.19.2
go: finding github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
go: finding golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
go: finding github.com/go-openapi/jsonpointer v0.19.3
go: finding honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
go: finding github.com/googleapis/gax-go/v2 v2.0.4
go: finding golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
go: finding go.opencensus.io v0.21.0
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/go-openapi/loads v0.19.0
go: finding golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c
go: finding golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
go: finding honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a
go: finding golang.org/x/exp v0.0.0-20190121172915-509febef88a4
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/kr/pty v1.1.5
go: finding google.golang.org/grpc v1.19.0
go: finding google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7
go: finding golang.org/x/tools v0.0.0-20190311212946-11955173bddd
go: finding github.com/google/go-cmp v0.2.0
go: finding golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
go: finding google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
go: finding golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
go: finding github.com/kr/pty v1.1.1
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/go-openapi/jsonreference v0.19.2
go: finding github.com/BurntSushi/toml v0.3.1
go: finding github.com/go-openapi/spec v0.17.0
go: finding honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
go: finding golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go: finding github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb
go: finding golang.org/x/tools v0.0.0-20190114222345-bf090417da8b
go: finding github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
go: finding google.golang.org/appengine v1.1.0
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding github.com/golang/mock v1.1.1
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961
go: finding cloud.google.com/go v0.26.0
go: finding github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277
go: finding github.com/go-openapi/validate v0.19.3
go: finding github.com/go-openapi/errors v0.17.0
go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
go: finding google.golang.org/grpc v1.20.1
go: finding github.com/hashicorp/golang-lru v0.5.0
go: finding golang.org/x/net v0.0.0-20190613194153-d28f0bde5980
go: finding golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
go: finding github.com/go-openapi/jsonpointer v0.19.2
go: finding github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: finding golang.org/x/tools v0.0.0-20190226205152-f727befe758c
go: finding golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b
go: finding github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329
go: finding github.com/client9/misspell v0.3.4
go: finding github.com/go-openapi/swag v0.17.0
go: finding golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
go: finding github.com/go-openapi/jsonpointer v0.17.0
go: finding golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
go: finding golang.org/x/net v0.0.0-20181005035420-146acd28ed58
go: finding github.com/go-openapi/runtime v0.19.4
go: finding google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
go: finding golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
go: finding github.com/go-openapi/swag v0.19.2
go: finding golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding github.com/go-openapi/strfmt v0.19.2
go: finding github.com/go-openapi/jsonreference v0.17.0
go: finding github.com/go-openapi/validate v0.19.2
go: finding github.com/go-openapi/analysis v0.19.4
go: finding github.com/go-openapi/strfmt v0.19.0
go: finding github.com/go-openapi/strfmt v0.17.0
go: finding github.com/go-openapi/loads v0.19.2
go: finding github.com/go-openapi/spec v0.19.2
go: finding github.com/go-openapi/runtime v0.19.0
go: finding github.com/PuerkitoBio/purell v1.1.1
go: finding github.com/PuerkitoBio/purell v1.1.0
go: finding github.com/go-openapi/analysis v0.19.2
go: finding golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
go: finding github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
go: finding github.com/go-openapi/jsonpointer v0.18.0
go: finding github.com/docker/go-units v0.3.3
go: finding github.com/go-openapi/spec v0.18.0
go: finding golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54
go: finding github.com/go-openapi/errors v0.18.0
go: finding golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576
go: finding golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53
go: finding github.com/go-openapi/strfmt v0.18.0
go: finding github.com/go-openapi/swag v0.18.0
go: finding github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe
go: finding github.com/go-openapi/loads v0.18.0
go: finding github.com/go-openapi/analysis v0.18.0
go: finding github.com/go-openapi/loads v0.17.0
go: finding github.com/pborman/uuid v1.2.0
go: finding github.com/go-openapi/jsonreference v0.18.0
go: finding github.com/go-openapi/validate v0.18.0
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/go-openapi/analysis v0.17.0
go: finding github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9
go: finding github.com/google/uuid v1.0.0
go: finding organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git v0.0.0-20190904164039-f21f29fd26c8
go: organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git@v0.0.0-20190904164039-f21f29fd26c8: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/***: exit status 128:
\tfatal: unable to connect to organization-swt.visualstudio.com:
\torganization-swt.visualstudio.com[0: 13.107.42.18]: errno=Connection timed out
\torganization-swt.visualstudio.com[1: 2620:1ec:21::18]: errno=Cannot assign requested address
go: error loading module requirements
"
Step #1 - "builder": 2019/09/12 22:59:13 2019/09/12 22:50:23 Building /tmp/staging589718210/srv, with main package at ./web, saving to /tmp/staging589718210/usr/local/bin/start
Step #1 - "builder": 2019/09/12 22:50:23 Running &{/usr/local/go/bin/go [go build -o /tmp/staging589718210/usr/local/bin/start ./web] [PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=*** HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GO111MODULE=on GOCACHE=/tmp/cache495806777 GOPATH=/go] /tmp/staging589718210/srv <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> <nil> false [] [] [] [] <nil> <nil>}
Step #1 - "builder": 2019/09/12 22:59:13 Wrote build output to /builder/outputs/output
Step #1 - "builder": 2019/09/12 22:59:13 Failed to build app: [go build -o /tmp/staging589718210/usr/local/bin/start ./web] with env [PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=*** HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GO111MODULE=on GOCACHE=/tmp/cache495806777 GOPATH=/go] failed: err=exit status 1, out="go: finding github.com/go-openapi/runtime v0.19.5
go: finding github.com/gorilla/mux v1.7.3
go: finding github.com/go-openapi/strfmt v0.19.3
go: finding golang.org/x/tools v0.0.0-20190617190820-da514acc4774
go: finding golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56
go: finding golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
go: finding google.golang.org/api v0.10.0
go: finding google.golang.org/appengine v1.6.2
go: finding github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a
go: finding github.com/go-stack/stack v1.8.0
go: finding github.com/mitchellh/mapstructure v1.1.2
go: finding github.com/go-openapi/analysis v0.19.5
go: finding go.mongodb.org/mongo-driver v1.0.3
go: finding github.com/go-openapi/swag v0.19.5
go: finding golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
go: finding google.golang.org/appengine v1.4.0
go: finding github.com/golang/protobuf v1.3.1
go: finding go.mongodb.org/mongo-driver v1.1.1
go: finding cloud.google.com/go v0.34.0
go: finding github.com/stretchr/testify v1.3.0
go: finding github.com/tidwall/pretty v1.0.0
go: finding golang.org/x/text v0.3.2
go: finding github.com/google/uuid v1.1.1
go: finding github.com/davecgh/go-spew v1.1.1
go: finding github.com/docker/go-units v0.4.0
go: finding github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63
go: finding github.com/kr/pretty v0.1.0
go: finding golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: finding golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5
go: finding golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b
go: finding golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e
go: finding github.com/kr/text v0.1.0
go: finding github.com/google/go-cmp v0.3.0
go: finding github.com/go-openapi/spec v0.19.3
go: finding golang.org/x/net v0.0.0-20190603091049-60506f45cf65
go: finding github.com/golang/protobuf v1.2.0
go: finding github.com/hashicorp/golang-lru v0.5.1
go: finding github.com/googleapis/gax-go/v2 v2.0.5
go: finding google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873
go: finding golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59
go: finding github.com/stretchr/objx v0.2.0
go: finding golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f
go: finding github.com/go-openapi/loads v0.19.3
go: finding golang.org/x/sys v0.0.0-20190606165138-5da285871e9c
go: finding golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8
go: finding cloud.google.com/go v0.38.0
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding github.com/google/martian v2.1.0+incompatible
go: finding github.com/stretchr/objx v0.1.0
go: finding github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024
go: finding golang.org/x/lint v0.0.0-20190409202823-959b441ac422
go: finding github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c
go: finding golang.org/x/net v0.0.0-20190311183353-d8887717615a
go: finding golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding github.com/golang/mock v1.2.0
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding google.golang.org/api v0.4.0
go: finding google.golang.org/appengine v1.5.0
go: finding golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6
go: finding golang.org/x/text v0.3.0
go: finding github.com/go-openapi/errors v0.19.2
go: finding github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57
go: finding golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f
go: finding github.com/go-openapi/jsonpointer v0.19.3
go: finding honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a
go: finding github.com/googleapis/gax-go/v2 v2.0.4
go: finding golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
go: finding go.opencensus.io v0.21.0
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/go-openapi/loads v0.19.0
go: finding golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c
go: finding golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
go: finding honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a
go: finding golang.org/x/exp v0.0.0-20190121172915-509febef88a4
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/stretchr/testify v1.4.0
go: finding github.com/kr/pty v1.1.5
go: finding google.golang.org/grpc v1.19.0
go: finding google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7
go: finding golang.org/x/tools v0.0.0-20190311212946-11955173bddd
go: finding github.com/google/go-cmp v0.2.0
go: finding golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: finding golang.org/x/net v0.0.0-20180724234803-3673e40ba225
go: finding google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19
go: finding golang.org/x/sys v0.0.0-20180830151530-49385e6e1522
go: finding github.com/kr/pty v1.1.1
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/go-openapi/jsonreference v0.19.2
go: finding github.com/BurntSushi/toml v0.3.1
go: finding github.com/go-openapi/spec v0.17.0
go: finding honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be
go: finding golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c
go: finding github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb
go: finding golang.org/x/tools v0.0.0-20190114222345-bf090417da8b
go: finding github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
go: finding google.golang.org/appengine v1.1.0
go: finding golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
go: finding github.com/golang/mock v1.1.1
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961
go: finding cloud.google.com/go v0.26.0
go: finding github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277
go: finding github.com/go-openapi/validate v0.19.3
go: finding github.com/go-openapi/errors v0.17.0
go: finding golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
go: finding google.golang.org/grpc v1.20.1
go: finding github.com/hashicorp/golang-lru v0.5.0
go: finding golang.org/x/net v0.0.0-20190613194153-d28f0bde5980
go: finding golang.org/x/tools v0.0.0-20190312170243-e65039ee4138
go: finding github.com/go-openapi/jsonpointer v0.19.2
go: finding github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: finding golang.org/x/tools v0.0.0-20190226205152-f727befe758c
go: finding golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b
go: finding github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329
go: finding github.com/client9/misspell v0.3.4
go: finding github.com/go-openapi/swag v0.17.0
go: finding golang.org/x/net v0.0.0-20190213061140-3a22650c66bd
go: finding github.com/go-openapi/jsonpointer v0.17.0
go: finding golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
go: finding golang.org/x/net v0.0.0-20181005035420-146acd28ed58
go: finding github.com/go-openapi/runtime v0.19.4
go: finding google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
go: finding golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
go: finding github.com/go-openapi/swag v0.19.2
go: finding golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3
go: finding github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
go: finding github.com/go-openapi/strfmt v0.19.2
go: finding github.com/go-openapi/jsonreference v0.17.0
go: finding github.com/go-openapi/validate v0.19.2
go: finding github.com/go-openapi/analysis v0.19.4
go: finding github.com/go-openapi/strfmt v0.19.0
go: finding github.com/go-openapi/strfmt v0.17.0
go: finding github.com/go-openapi/loads v0.19.2
go: finding github.com/go-openapi/spec v0.19.2
go: finding github.com/go-openapi/runtime v0.19.0
go: finding github.com/PuerkitoBio/purell v1.1.1
go: finding github.com/PuerkitoBio/purell v1.1.0
go: finding github.com/go-openapi/analysis v0.19.2
go: finding golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3
go: finding github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
go: finding github.com/go-openapi/jsonpointer v0.18.0
go: finding github.com/docker/go-units v0.3.3
go: finding github.com/go-openapi/spec v0.18.0
go: finding golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54
go: finding github.com/go-openapi/errors v0.18.0
go: finding golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576
go: finding golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53
go: finding github.com/go-openapi/strfmt v0.18.0
go: finding github.com/go-openapi/swag v0.18.0
go: finding github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe
go: finding github.com/go-openapi/loads v0.18.0
go: finding github.com/go-openapi/analysis v0.18.0
go: finding github.com/go-openapi/loads v0.17.0
go: finding github.com/pborman/uuid v1.2.0
go: finding github.com/go-openapi/jsonreference v0.18.0
go: finding github.com/go-openapi/validate v0.18.0
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/go-openapi/analysis v0.17.0
go: finding github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9
go: finding github.com/google/uuid v1.0.0
go: finding organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git v0.0.0-20190904164039-f21f29fd26c8
go: organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git@v0.0.0-20190904164039-f21f29fd26c8: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /go/pkg/mod/cache/vcs/***: exit status 128:
\tfatal: unable to connect to organization-swt.visualstudio.com:
\torganization-swt.visualstudio.com[0: 13.107.42.18]: errno=Connection timed out
\torganization-swt.visualstudio.com[1: 2620:1ec:21::18]: errno=Cannot assign requested address
go: error loading module requirements
"
Finished Step #1 - "builder"
ERROR
ERROR: build step 1 "gcr.io/gae-runtimes/go111_app_builder:go111_20190827_1_11_12_RC00" failed: exit status 1

I expect this. The problem is that organization-swt.visualstudio.com is a private repository. I need to get credentials into this gcr.io/gae-runtimes/go111_app_builder build.

How do I inject extra steps into this gcr.io/gae-runtimes/go111_app_builder build to set my credentials?

I have a ssh key for the repository and I have followed the instructions at (https://cloud.google.com/cloud-build/docs/access-private-github-repos) to set it up on my keyring for the project. I can even perform the clone in a build from the sample on this page so I know the key works and is available:

starting build "***"

FETCHSOURCE
Fetching storage object: gs://***_cloudbuild/source/***
Copying gs://***_cloudbuild/source/***
/ [0 files][ 0.0 B/104.2 KiB] / [1 files][104.2 KiB/104.2 KiB]
Operation completed over 1 objects/104.2 KiB.
BUILD
Starting Step #0
Step #0: Already have image (with digest): gcr.io/cloud-builders/gcloud
Finished Step #0
Starting Step #1
Step #1: Already have image (with digest): gcr.io/cloud-builders/git
Finished Step #1
Starting Step #2
Step #2: Already have image (with digest): gcr.io/cloud-builders/git
Step #2: Cloning into 'GROUP-domain'...
Step #2: Warning: Permanently added the RSA host key for IP address '*.*.*.*' to the list of known hosts.
Finished Step #2
PUSH
DONE

Is there a way to inject those first two build steps into or before gcr.io/gae-runtimes/go111_app_builderand use the SSH for the private repository git@ssh.dev.azure.com:v3/organization-swt/PROJECT/GROUP-domain?

I also have a PAT for the HTTPS repository organization-swt.visualstudio.com/PROJECT/_git/GROUP-domain.git Is there a way to use something like git global url insteadOf before the build to sub in my token?

How do I get access to a private repository in the Cloud Build kicked off by deploying a GCP standard app?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?