GoogleCloudPlatform / cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
https://cloud.run
Apache License 2.0
526 stars 91 forks source link

Use with Private Repos #94

Closed akash-joshi closed 4 years ago

akash-joshi commented 4 years ago

Hey, what would be required to make cloud-run-button work with private repos, some kind of GitHub API token mechanism ?

akash-joshi commented 4 years ago

I'm willing to work on this, but don't know what's required

ahmetb commented 4 years ago

Can you explain your use case? Why do you need it with private repos.

akash-joshi commented 4 years ago

Well @ahmetb , I need it to deploy my private repos to Cloud Run

ahmetb commented 4 years ago

We have other deployment methods like gcloud. Why don’t you use them instead?

This repository is for making a repository deployable by multiple people. If you have an organizational setup with private repos, I’m happy to discuss what we can do there. But for personal private repos, this is currently not the right tool.

akash-joshi commented 4 years ago

Well @ahmetb , I have some applications which will benefit from the serverless model provided by cloudrun by default. Having something like the cloudrun button provides easy deployments to any repo, akin to what Netlify does

ahmetb commented 4 years ago

We're already looking at a "one-command to deploy" model like you've described in a separate effort, but that would be a command-line tool and not a UI experience like this one.

akash-joshi commented 4 years ago

Is the cloudshell image used in this repo open source ? @ahmetb

ahmetb commented 4 years ago

The image is available publicly, but its build system is not open source. You'll find that most of the cloudshell command is collection of bash or python scripts anyway. You can inspect their source code.

akash-joshi commented 4 years ago

Ahh, using this it actually works @ahmetb : https://github.community/t5/How-to-use-Git-and-GitHub/Clone-private-repo/td-p/12616

But gives an error :

Screenshot 2019-09-30 at 1 33 59 PM

This file is the culprit :

https://github.com/GoogleCloudPlatform/cloud-run-button/blob/master/cmd/cloudshell_open/clone.go

Just the regex needs to be updated

akash-joshi commented 4 years ago

Can I take this up ?

ahmetb commented 4 years ago

No please do not do that.

I'm sorry, but you're attempting to do something that shouldn't be done with this tool. You're free to fork this repo and take snippets from this repo to write a new program that can help you deploy your repos. You can pretty much write a 5-line bash script that does everything this repo does in your use case.

ahmetb commented 4 years ago

Also:

akash-joshi commented 4 years ago

Ohh okay, what would the bash script look like ?

ahmetb commented 4 years ago

Please refer to Cloud Run documentation. We have a few tutorials and how-to guides on how to build and deploy apps. Similarly the cloud-run-button also shows you the commands it executes, try the demo and see what it does. Also please consider moving further discussion to another forum like Stackoverflow as it no longer pertains the original issue.

akash-joshi commented 4 years ago

Thanks

akash-joshi commented 4 years ago

Maybe put this thread as FAQ or something

jamesward commented 4 years ago

I can see a use case for this where a company might have some private starter / sample repos in their GitHub org. That would make sense but would take some work to make happen.

But it sounds like what you really need is a CI/CD pipeline for your projects instead of using Button to deploy them.

hermanbanken commented 1 year ago

You'd want a Cloud Shell script/tutorial that: