【问题标题】:Connect to Enterprise GitHub from Terraform cloud function从 Terraform 云功能连接到 Enterprise GitHub
【发布时间】:2021-12-17 22:08:30
【问题描述】:

我正在尝试通过 Terraform 创建一个 Google Cloud 功能。该函数的源代码在 Enterprise GitHub 中。 https://github.xyz.com/cf

Terraform 代码如下:

resource "google_cloudfunctions_function" "cfcluster" {
  name        = "cfcluster1"
  project = "${var.project_id}"
  region  = "us-central1"

  
  runtime     = "python39"

  source_repository  {
//url="https://github.xyz.com/cf" #is this possible?
}

是否可以从 Terraform 中的 Google CloudFunction 连接到 Enterprise GitHub?我怎样才能实现它?

注意

我不想从 Terraform 连接到云源存储库。

【问题讨论】:

  • User1403505,请阅读以下一般发帖提示: (1) 在提交问题之前运行拼写检查; (2)观察单词的大小写——像Terraform这样的软件名称需要一个大写字母,像谷歌这样的品牌也是如此; (3) 注意像 Git 这样的产品和像git 这样的命令之间的区别; (四)不求乞求; (5) 使用面向行动的陈述,例如“我如何做 X”和“如何实现 X”。提出具体和重点突出的问题,而不是please help me
  • 如果您能遵守一些基本准则,您会发现在这里过得更轻松。您以前曾收到过反对票,如果您能提高发帖质量,这种情况可能会减少。

标签: github google-cloud-platform terraform github-enterprise


【解决方案1】:

我认为您不能直接从 GitHub 存储库中提取数据。您可以做的是将其镜像到您项目的云存储库中,然后您可以根据需要使用 Google Cloud Platform 中的数据。您可以在此处找到有关如何镜像 GitHub 存储库 [1] 的文档。

您还可以查看本教程 [2],您可以在此处找到从 Github 存储库在 Google Cloud Platform 中部署应用程序的完整步骤。

[1]https://cloud.google.com/source-repositories/docs/mirroring-a-github-repository

[2]https://medium.com/swlh/deploying-github-repository-to-google-cloud-platform-997d296547e6

【讨论】:

    猜你喜欢
    • 2020-04-25
    • 1970-01-01
    • 2020-10-28
    • 1970-01-01
    • 2018-12-01
    • 2021-01-25
    • 2022-07-29
    • 1970-01-01
    • 2018-01-01
    相关资源
    最近更新 更多