Dar*_*aik 2 continuous-integration google-cloud-platform google-cloud-build
我有一台服务器,我们的测试用例在 GCP 的计算引擎上运行所有 API。如何从云构建 CI/CD 管道连接它,以便 CI/CD 阶段仅传递来自服务器的200响应状态代码?
GCP 表示创建自定义构建步骤(此处)。文档不是很清楚
你有2个解决方案。
ENTRYPOINT将在 Cloud Build 管道中调用的容器来完成它steps:
- name: gcr.io/cloud-builders/gcloud
entrypoint: "bash"
args:
- "-c"
- |
RESPONSE=$(curl -i <YOUR URL> | grep HTTP | cut -d' ' -f2)
if [ "200" != "$$RESPONSE" ]; then exit 1; fi
Run Code Online (Sandbox Code Playgroud)
请注意双重$$以防止 Cloud Build 查看替换变量
| 归档时间: |
|
| 查看次数: |
4250 次 |
| 最近记录: |