kubernetes - How can I template an artifact reference in an upstream Spinnaker stage?
问题描述
Looking at the source of one of my Spinnaker pipelines, my Build stage has the following artifact listed in it's context:
"context": {
"account": "default",
"artifacts": [
{
"location": "goldengoose",
"metadata": {
"account": "default"
},
"name": "goldengoose-build",
"reference": "goldengoose-build-v007",
"type": "kubernetes/Build",
"version": "v007"
}
], ...
How can I access the reference field of this artifact in an upstream stage and template it into a Kubernetes deploy manifest stage? I am trying to do something like the following in the manifest source:
${#stage("Build")["context"]["artifacts"]["0"]["reference"]}
but the required value isn't being replaced. Is there a way to get this to work?
解决方案
将 ["0"] 替换为 [0] - 它是数组的索引。
推荐阅读
- environment-variables - Bitbucket 管道环境变量以触发管道步骤
- swift - 如何使用 Apple HealthKit 监控 headphoneAudioExposureEvent?
- css - 引导切换器不显示内容
- qt - QT QML将文本区域放在工具栏底部而不使用应用程序“标题”
- r - 过滤仅包含 R 中某些字母的字符串
- node.js - 使用 SAML 身份验证解耦应用程序
- swift - 如何将 UUID 转换为 base 64,反之亦然
- php - 更改托管服务器后,乌尔都语单词无法正确显示
- text - 格式丢失:getApplication()->input->post->getArray()
- http - GZIP 编码数据包