【问题标题】:Google Cloud Container Builder share data between steps?Google Cloud Container Builder 在步骤之间共享数据?
【发布时间】:2018-04-15 18:33:30
【问题描述】:

我的构建步骤之一需要简短的 git commit sha (git rev-parse --short HEAD)。除了实际使用 git 构建器,然后在 docker build 步骤中使用输出之外,我没有看到任何其他方法。下面输出我需要的内容,我想将该值存储在 COMMIT_SHA_SHORT 中并在下一个构建步骤中使用它。这有可能吗?

steps:
- name: 'gcr.io/cloud-builders/git'
  args: ['rev-parse', '--short', 'HEAD']

【问题讨论】:

标签: google-cloud-platform google-container-builder


【解决方案1】:

您可以使用 Container Builder 自定义构建 [1]。

自定义构建步骤是 Container Builder 工作虚拟机提取并运行的容器映像,您的源卷安装到 /workspace。您的自定义构建步骤可以执行容器内的任何脚本或二进制文件;因此,它可以做任何容器可以做的事情。

[1]https://cloud.google.com/container-builder/docs/create-custom-build-steps

【讨论】:

  • 这正是我希望存在的 :)
猜你喜欢
  • 1970-01-01
  • 2017-08-06
  • 1970-01-01
  • 2019-06-17
  • 2018-09-24
  • 2015-12-04
  • 1970-01-01
  • 2018-01-15
  • 1970-01-01
相关资源
最近更新 更多