我在这里关注了 Google CloudBuild 的文档:https ://cloud.google.com/cloud-build/docs/configuring-builds/store-images-artifacts
所以这是我的cloudbuild.yaml
配置:
steps:
- name: gcr.io/cloud-builders/git
id: git-checkout
args: [ 'fetch','--tags','--unshallow']
- name: openjdk
id: gradle-build
args: [
'./gradlew',
'--build-cache',
'-Si',
'-Panalytics.buildId=$BUILD_ID',
'-PgithubToken=$_GITHUB_TOKEN',
'-g', '$_GRADLE_CACHE',
'build'
]
artifacts:
objects:
location: ['gs://my-bucket/artifacts/']
paths: ["build/libs/*.jar"]
如果我注释掉以下内容,则它会成功运行:
artifacts:
objects:
location: ['gs://my-bucket/artifacts/']
paths: ["build/libs/*.jar"]
如果没有注释,我会从 CloudBuild 控制台收到以下错误:
failed unmarshalling build config cloudbuild.yaml: json: cannot unmarshal array into Go value of type string
在Logs部分下,它只是说Logs available。