我的应用程序同时使用公共和私有github第三方依赖项,我正在尝试使用endly(https://github.com/viant/endly)在docker容器中构建我的应用程序。
当我运行endly -r=app时,我看到了以下问题:克隆到'/tmp/go/src/github.com/xxxx/private_repo'...remote:用户名或密码无效。
如何指定私有repo凭据?出于安全原因,我不想在任何地方硬编码原始凭据。
app.yaml
defaults:
version: 1.1
app: myapp
sdk: go:1.9
pipeline:
build:
workflow: app/docker/build
origin:
URL: ./../
credentials: localhost
buildPath: /tmp/go/src/github.com/myapp
commands:
- export GOPATH=/tmp/go
- cd $buildPath/myapp
- go get -u .
- export CGO_ENABLED=0
- go build -o $app
- chmod +x $app
download:
/$buildPath/${app}: $releasePath发布于 2018-05-15 03:10:17
Endly使用加密凭据来处理秘密,它还混淆了stdout和日志中的条目。
在您的构建中,私有身份验证在go get -u之后发生,因此请确保添加以下内容:
中的引用条目的秘密节点
- $output:/Username/? ${github.username}
- $output:/Password/? ${github.password}
@app.yaml
defaults:
version: 1.1
app: myapp
sdk: go:1.9
pipeline:
build:
workflow: app/docker/build
origin:
URL: ./../
credentials: localhost
buildPath: /tmp/go/src/github.com/myapp
secrets:
github: git #loads ~/.secet/git.json with encrypted credentials.
commands:
- export GOPATH=/tmp/go
- cd $buildPath/myapp
- export GIT_TERMINAL_PROMPT=1
- go get -u .
- $output:/Username/? ${github.username}
- $output:/Password/? ${github.password}
- export CGO_ENABLED=0
- go build -o $app
- chmod +x $app
download:
/$buildPath/${app}: $releasePath使用以下命令执行see more about secret
https://stackoverflow.com/questions/50262553
复制相似问题