Closed akash-joshi closed 4 years ago
I'm willing to work on this, but don't know what's required
Can you explain your use case? Why do you need it with private repos.
Well @ahmetb , I need it to deploy my private repos to Cloud Run
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.
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
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.
Is the cloudshell image used in this repo open source ? @ahmetb
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.
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 :
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
Can I take this up ?
No please do not do that.
Passing secrets as part of the repo URL is definitely NOT secure. You should not transmit your GitHub username/password like this. We log the git repo URLs for analytics purposes and your password would show up in our systems.
This will not work with 2-factor authentication, and therefore most users can't make use of this.
Your secrets like ssh public keys won't be available on Cloud Shell machine since Open in Cloud Shell experience gives a clean machine environment on every run.
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.
Also:
Ohh okay, what would the bash script look like ?
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.
Thanks
Maybe put this thread as FAQ or something
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.
You'd want a Cloud Shell script/tutorial that:
Hey, what would be required to make cloud-run-button work with private repos, some kind of GitHub API token mechanism ?