-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support GitHub repositories with google_cloudbuild_trigger #1950
Comments
It seems that this functionality is not implemented even in the GCP CloudBuild API |
You'll need to manually create a source repository that mirrors the GitHub repo first. |
Adding a different resource that would create the mirror between the GitHub and CSR repository would also solve this. But I can imagine the difficulty being that there is now the authentication flow in that action (when performed in the Console). Edit: |
I guess the ...which is mentioned as read-only:
Until that changes, I assume manually creating the mirrored source repository is what's required to allow cloudbuild triggers from a mirrored repo (?). |
There is a way of triggering builds from GitHub via https://github.com/marketplace/google-cloud-build I'm not sure if the current |
https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.triggers#GitHubEventsConfig is promising, though no promises on any sort of timeline for TF integration. I'll at least remove the upstream label since it appears to no longer be blocked. |
@danawillow any update on this ? |
Since the API documentation says that the field is experimental, I'd prefer not to add TF support for it at the moment. You might be able to help us out by pushing on that team to get something stable ready that we can use :) |
@danawillow What is the best way to do so? Via our GCP account contact, or is there some other path we can use? Thanks! |
I got this response from a cloudbuild engineer a few weeks ago:
|
This just in:
|
Hey, that's great - let me take a look at what this will take. :) |
It's fantastic that support for this has landed in beta 👍 Is it sensible to suggest that the |
Hi @ndmckinley , It's nice to see that cloudbuild-github branch has been merged into master, so probably this feature will be released soon. BTW, I was trying to get a preview of this feature so I've cloned the magic-modules repo, checkout the master branch and applied all the instructions reported here here. I succeeded to compile both google and google-beta providers coming from the master branch (all the tests have passed as well). github {
owner = "${var.WORLD_REPO_OWNER}"
name = "${var.WORLD_REPO_NAME}"
push {
tag = ".*"
}
} I still get the error: Error: Unsupported block type
on triggers.tf line 8, in resource "google_cloudbuild_trigger" "world-trigger":
8: github {
Blocks of type "github" are not expected here. Why I'm not hitting the right version of the GCP provider I've compiled myself (and the one I expect to have this new feature)? Is there something that I'm missing? I really appreciate your help since I'm stuck with this error. Best regards, |
Would you mind posting a new issue? We can determine if this is a good idea by 👍s on that issue. We try to keep the number of configuration environment variables down, but if a good number of people want this, then we'd be willing to do it.
Can you post the output of |
@ndmckinley okay no problem, that's done in #4629. |
HI Nathan and thanks for your quick response. $ terraform version
Terraform v0.12.9
Your version of Terraform is out of date! The latest version
is 0.12.10. You can update by downloading from www.terraform.io/downloads.html In the providers.tf file I have only declared the google-beta as follows provider "google-beta" {
credentials = "${file("${var.CREDENTIAL_FILE}")}"
project = "${var.PROJECT_ID}"
region = "${var.REGION}"
} Any clue? |
If you only provide
https://www.terraform.io/docs/providers/google/provider_versions.html Are you doing that? It's not in the config fragment you posted. |
Is there a way to automate the creation of a respository mapping? Currently I'd get
but I guess that isn't really an automated way... |
To the best of my knowledge there isn't one, no. If there is one, it's not in the REST spec - if you find a flow we can sensibly automate we'll seriously consider it. |
Ah, that's a shame because the Google Cloud Build GitHub app is authorised for all repositories in the organisation, so it's not like authorisation is the blocker. I was hoping the Is there anywhere we can make a feature request for GitHub repository connection in the GCP API? |
Ah, I found where to make a feature request and have done so. If anyone is interested in this feature, please 'star' it. |
@ndmckinley, what's remaining here in order to close this? |
Ah, this should have been closed back in early October, sorry about that! |
Has support for this arrived in the non-beta provider? According to the documentation the |
That's correct- the beta provider tracks GCP beta features, so it'll stay in the beta provider as long as the GCP functionality is still in beta (see https://cloud.google.com/cloud-build/docs/create-github-app-triggers and https://www.terraform.io/docs/providers/google/guides/provider_versions.html) Once it goes GA in GCP, feel free to open an issue to have it moved to the GA provider. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Google's cloud build service allows a user to run CI workloads for code hosted on GitHub, Bitbucket, and Google Cloud Source Repositories (CSRs). Currently, google_cloudbuild_trigger resource only supports CSRs.
This feature request is to support GitHub specifically, though I imagine Bitbucket support would also be valuable to end users.
The text was updated successfully, but these errors were encountered: