Skip to content
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 for manually invoked builds to google_cloudbuild_trigger #8374

Comments

@pairaksi
Copy link

pairaksi commented Feb 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.

Description

You are able to create manual triggers in GCP console.
https://cloud.google.com/cloud-build/docs/automating-builds/create-manual-triggers

Same would be nice to have supported with google_cloudbuild_trigger

New or Affected Resource(s)

google_cloudbuild_trigger

Potential Terraform Configuration

References

@slevenick
Copy link
Collaborator

We initially thought this was for triggering manual builds which is something we likely don't want to support. This is actually a request for creating a trigger that can be manually run. This is described in the linked docs page.

I'm unable to figure out exactly how this would be done via the existing API though. This might be done by not setting any explicit triggers in the existing resource

@slevenick slevenick removed their assignment Feb 8, 2021
@rileykarson rileykarson added this to the Goals milestone Feb 22, 2021
@bruno-morel
Copy link

bruno-morel commented Mar 15, 2021

It's indeed undocumented (at least publically) => https://cloud.google.com/build/docs/api/reference/rest/v1/projects.triggers#BuildTrigger

I've opened a support ticket to either release the API documentation linked to this, or make it explicit that it's not available from the APIs from Google....
Anyone that's also interested should probably do the same in their GCP support account?

@LondonAppDev
Copy link

I opened a bug on the Google issue tracker as per their feature request process: https://issuetracker.google.com/issues/192637573

Might be useful to vote for it with a ⭐:
Screenshot 2021-07-14 at 20 15 22

@ilango100
Copy link

While waiting for the solution, my workaround is to set ignored_files = ["**/*"]. This makes sure that the trigger is not run on any change, but can be triggered manually or through API.

Hope this helps

@lion7
Copy link

lion7 commented Jan 13, 2022

You can actually create a webhook trigger without any secret, which results into a manual trigger on GCP:

resource "google_cloudbuild_trigger" "my-trigger" {
  name = "my-trigger"

  webhook_config {
    secret = ""
  }

  build {
     ...
  }
}

@jaismith
Copy link

jaismith commented Jan 14, 2022

@lion7 this deploys successfully for me but the trigger in GCP appears not to have the 'webhook' option enabled, maybe because it is missing the sourceToBuild argument? Is this still working for you?

@lion7
Copy link

lion7 commented Jan 14, 2022

No, the source I specified in the build section doesn't appear at all. I have to manually correct it in the gcp console after applying terraform.

It is also broken when the trigger is a pub/sub topic. In that case the provided source is also not showing up.

@abhinavrau
Copy link

I would like to work on this issue. I have added support for it on my fork of magic-modules here. I will be submitting a PR soon

@hspak
Copy link

hspak commented Mar 7, 2022

Hello,

I see that this issue was closed, but I don't see this feature list in the latest release notes: https://github.com/hashicorp/terraform-provider-google/releases/tag/v4.13.0

Will this be included in the next release?

Thank you!

@github-actions
Copy link

github-actions bot commented Apr 7, 2022

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.