英文:
how to upload folder in artifacts GCP storage
问题
如何上传文件夹至构件中:
我的 cloudbuild.yaml
中的代码:
artifacts:
objects:
location: 'REDACTED'
paths: ['REDACTED']
英文:
How to upload folder in artifacts:
My code in cloudbuild.yaml:
artifacts:
objects:
location: 'REDACTED'
paths: ['REDACTED']
答案1
得分: 0
你已经走在正确的轨道上。根据文档:
定义你的_YAML_构建配置文件。
artifacts:
objects:
location: [STORAGE_LOCATION]
paths: [[ARTIFACT_PATH],[ARTIFACT_PATH], ...]
其中,
[STORAGE_LOCATION]
:Cloud Build必须存储工件的Cloud Storage存储桶或存储桶内的文件夹,例如 gs://mybucket 或 gs://mybucket/some/folder。[ARTIFACT_PATH]
:一个或多个工件的路径。
然后,您需要使用适当的值替换方括号[]
中的值。参见上传文件和文件夹的示例。
一旦您的构建成功完成,您可以在位于 [STORAGE_LOCATION]
/artifacts-$BUILD_ID.json` 的 JSON 清单文件中找到上传结果。
编辑
截至今天,文档指出了以下内容:
-
您只能指定一个用于上传工件的存储桶,并且您必须是该存储桶的所有者。
-
您可以指定存储桶中的有效目录路径。
-
您可以上传任意数量的工件,但只能指定多达一百个工件路径。
已经为指定多个存储桶位置创建了一个功能请求,您可以通过问题跟踪器进行关注。
英文:
You are on the right track. From the documentation:
Define your YAML build configuration file.
artifacts:
objects:
location: [STORAGE_LOCATION]
paths: [[ARTIFACT_PATH],[ARTIFACT_PATH], ...]
Where,
[STORAGE_LOCATION]
: A Cloud Storage bucket or a folder within the bucket where Cloud Build must store the artifact, such as gs://mybucket or gs://mybucket/some/folder.[ARTIFACT_PATH]
: Path to one or more artifacts.
Then, you will need to replace the values in brackets []
with the appropriate values. See example for uploading files and folders.
Once your build completes successfully, you can find the upload results in the JSON manifest file located at [STORAGE_LOCATION]
/artifacts-$BUILD_ID.json`.
Edited
As of today, the documentation points out the following:
-
You can specify only one bucket to upload the artifacts and you must be the owner of the bucket.
-
You can specify a valid directory path in the bucket.
-
You can upload any number of artifacts, but you can specify only up to one hundred artifact paths.
There is already a feature request created for specifying multiple bucket locations that you can follow via Issue Tracker.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论