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
525 stars 91 forks source link

Support GitLab #176

Closed tyayers closed 3 years ago

tyayers commented 4 years ago

Wanted to use this with my GitLab project, but an error message is shown that only GitHub and Bitbucket are supported.. Why not support other git platforms like GitLab as well? Thanks

glasnt commented 4 years ago

I took a look and it seems while GitLab is implemented from some perspectives, it doesn't work from others.

Testing repo: https://gitlab.com/glasnt/hello-cloudrun

Clicking the button when the URL is just https://deploy.cloud.run, the follow plain HTML is returned:

"Cannot infer which repository to deploy (Referer header was not present). Go back, and click the 'Run on Google Cloud' button directly from the repository page."

Specifying a ?git_repo=https://gitlab.com/glasnt/hello-cloudrun, a modal popup error from cloud shell:

Open in Cloud Shell Errors: The git_repo param is invalid or missing. git_repo must be a valid URL from either 'github.com' or 'bitbucket.org'.

From there, clicking 'Close', waiting for the shell to load, then entering:

cloudshell_open --repo_url "https://gitlab.com/glasnt/hello-cloudrun.git" --page "shell"

Enters me into the expected workflow.

jamesward commented 4 years ago

Looks like there is a limitation with Cloud Shell that we will escalate internally.

ahmetb commented 4 years ago

Thanks @jamesward. Yeah, it seems like a check that was added after we started supporting GitLab. So the request doesn't even make it to our code currently. Other than that GitLab should be working, we have tests in place for those.

tyayers commented 4 years ago

That would be great to get it working again.. Would love to use the button in Gitlab repos to easily push deployments to Cloud Run

jamesward commented 3 years ago

This appears to be fixed!