我遇到的所有示例都采用以下格式:
gcloud container builds submit --config cloudbuild.yaml .
手册页说明如下:
[SOURCE]
The source directory on local disk or tarball in Google Cloud Storage
or disk to use for this build. If source is a local directory this
command skips files specified in the .gcloudignore file (see $ gcloud
topic gcloudignore for more information).
现在,我本地磁盘上的源目录非常大,并且花费了大量时间将源代码从我的本地机器传输到 Google 构建服务器/云。是否有以下可能?如何?
最佳答案
不幸的是,今天在 gcloud
中对此没有很好的支持。 .不过,您可以通过其他几种方式完成此操作:
curl
或您选择的客户端库发送 API 请求以请求指定 RepoSource
的构建.例如:{
“来源”: {
“ repo 源”:{
"repoName": "我的仓库",
"commitSha": "死牛肉"
}
},
“脚步”: [...]
}
gcloud
构建它:git checkout && gcloud 容器构建提交。 --config=cloudbuild.yaml
curl
或客户端库。 关于google-cloud-platform - 通过 gcloud 命令行工具触发特定 git 提交的构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48962597/