-
Notifications
You must be signed in to change notification settings - Fork 595
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
Create/Update Triggers with gcloud #99
Comments
Thank you for the feedback. There are two aspects for creating triggers - one could be in a CLI (and I'll show you how to do it with curl etc), and one cannot. The one we cannot do outside of the UI is the synchronization of a github or bitbucket repo with your Google cloud source repo. If this part is the annoyance for you, then I apologize but for now you must use the UI. Once the repo is sychronized, you can create triggers using curl as so: Make the request file
$PATH_TO_CONFIG_FILE is the path to your cloudbuild.yaml configuration, relative to the repo root. You can also use tagName instead of branchName. The value for these fields is a regular expression. Then make the request:
Let me know if this works out for you. |
@skelterjohn, thanks for the reply, I understand your answer, It's just that, by deciding to use cloud-builder instead of say, Jenkins. This would be the one part of the infrastructure, that would never be able to be automated. Feel free to close this issue, if you don't think it is a future option. |
I understand. I'll leave this issue open - I'd certainly like to see this entire process work within the CLI. |
cli support for triggers would be awesome to have :) |
@skelterjohn I've used the instructions here but got things a little bit confused... I've tried to create triggers using Here is a trigger I've created using the UI:
When I try to run it, this is what I get:
I suspect it's because I tried creating triggers before enabling the API and something didn't get initialised correctly, or it could be to do with IAM setup in this project, and I don't know where to look. I've also tried using |
@errordeveloper Thanks for reporting this! The underlying cause was an unfortunate bug in a recent migration, wherein newly created triggers since yesterday would not be directly runnable (they would still trigger). That issue has now been fixed and verified by one of our engineers. Can you try again and let me know if you're still seeing the error? |
@imjasonh thanks a lot! I can confirm my trigger works now. |
Please could somebody confirm if it is possible to view/use Cloud Source Repositories from other projects on the Container Builder Trigger page - I can't seem to get this to work, even though I'm sure I've given the correct permissions. There only seems to be an API for this as I can't find any info in the SDK. Thanks |
Hey @3lll , I don't think you can create a Build Trigger on a CSRepository from another GCP project. If the source of the code is in GitHub/Bitbucket, you could just create a mirror in each project. |
Thanks Philippe....
Trying to avoid adding other programs! I'll use the dev project trigger to
push up from dev to prod.... I was hoping to pull!
…On 22 April 2018 at 01:10, Philippe Modard ***@***.***> wrote:
Hey @3lll <https://github.com/3lll> , I don't think you can create a
Build Trigger on a CSRepository from another GCP project.
If the source of the code is in GitHub/Bitbucket, you could just create a
mirror in each project.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#99 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AH_JhQACpvTVW_2dniU-UXSjiZiyOrSmks5tq7xqgaJpZM4OdfTD>
.
--
Thanks
Tony Legge
3lll Asia
+33 6 87 96 39 81
|
@skelterjohn Can this be accomplished via a Cloud Function? |
Any updates on this issue? 😇 |
@arinto Especially since clicking the "Add trigger" button does not seem to be working in the UI today! Would also love to get trigger creation for github repos into my automation. https://status.cloud.google.com/incident/developers-console/18005 |
Wondering if this will be included inside the Also @alancmclean I think it's possible except for the how to save the credentials required to authenticate the request. I wonder if there's a way to keep the credentials decrypted and encrypted only during runtime. Also can we use this for private repository? |
I am surprised it is not possible to set up triggers inside the
This way you can specify to trigger the pipeline on specific branches or tags. I think such an option would add a lot of value since I could have more of my infrastructure inside my source control. |
Just wondering if there's a REST API provided to mirror repository from Bitbucket/Github to Google Source Repository so that I can create the trigger using the REST API 🤔 |
Hi!
See https://cloud.google.com/sdk/gcloud/reference/alpha/builds/triggers/ for documentation. |
@irvifa You can actually use the REST API for Bitbucket/Github without using GSR at all. The trick is that the repo name shown in the GUI is not what you need to put in the request body. I used Chrome dev tools to capture the request in the console and find the actual name given to my Bitbucket repo. Now I can create triggers using the REST API. For example in the console the repo might be myteam/my-repo but the name given to it by GCP is bitbucket_myteam_my-repo. If you put in the wrong name it will treat it like a GSR repo instead and give a warning that the repo does not exist. Edit: I looked into this further and it seems that GCP creates a linked Cloud Source Repo for each Bitbucket or Github repo you connect. To find the name of the linked CSR repo you can just view the console for CSR. |
This GitHub issue tracker is intended for bugs with the officially supported builder images specifically. |
add traceroute tool
I wasn't sure where to post this issue, but it would be nice to have a command line way to create triggers. I have a lot of microservices and it takes a lot of effort to add triggers via the UI.
The text was updated successfully, but these errors were encountered: