如何使用 BitBucket 管道在推送后更新 Google Cloud Compute Engine 实例?



我已经看过有关如何使用 App Engine 完成此操作的文档,但没有关于计算引擎的文档。谢谢!

您可以使用云部署管理器 API 编写计算引擎应用程序。 https://cloud.google.com/deployment-manager

这篇 Atlassian 博客文章中的"bitbucket-pipelines.yml"文件的最后一行是"gcloud app deploy",用于更新 App Engine 应用程序 https://confluence.atlassian.com/bitbucket/deploy-to-google-cloud-900820342.html。

# Deploying the application
- gcloud -q app deploy app.yaml

对于部署管理器 API,请使用"gcloud deployment-manager deployments update https://cloud.google.com/sdk/gcloud/reference/deployment-manager/deployments/update"。

例如:

# Deploying the application
- gcloud -q deployment-manager deployments update my-deployment --config config.yaml

我建议你查看将部署管理器 API 与 CI/CD 管道配合使用的最佳做法。 https://cloud.google.com/deployment-manager/docs/best-practices/#continuous_integration_ci_continuous_deployment_cd

最新更新