【发布时间】:2020-12-22 13:25:48
【问题描述】:
如标题所述,我想知道是否可以从 Cloud Build 步骤开始并使用 pubsub 模拟器?
options:
env:
- GO111MODULE=on
- GOPROXY=https://proxy.golang.org
- PUBSUB_EMULATOR_HOST=localhost:8085
volumes:
- name: "go-modules"
path: "/go"
steps:
- name: "golang:1.14"
args: ["go", "build", "."]
# Starts the cloud pubsub emulator
- name: 'gcr.io/cloud-builders/gcloud'
entrypoint: 'bash'
args: [
'-c',
'gcloud beta emulators pubsub start --host-port 0.0.0.0:8085 &'
]
- name: "golang:1.14"
args: ["go", "test", "./..."]
对于我需要的测试,它可以在本地运行,而不是使用来自云构建的专用 pubsub,我想使用模拟器。
谢谢
【问题讨论】:
标签: continuous-integration google-cloud-pubsub google-cloud-build