cloud-run-button icon indicating copy to clipboard operation
cloud-run-button copied to clipboard

Ability to provide environment variables via URL parameters

Open mikenikles opened this issue 4 years ago • 2 comments
trafficstars

Hi 👋,

It'd be great if env variables could be provided via URL parameters so that there's no need to commit an app.json file to the repository.

As an example, https://github.com/gitpod-io/openvscode-releases contains a Dockerfile that needs a RELEASE_TAG argument. I'd love to create a Cloud Run button like this:

[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/gitpod-io/openvscode-releases&env=RELEASE_TAG:openvscode-server-v1.60.0)

Cheers, Mike

mikenikles avatar Sep 23 '21 03:09 mikenikles

Yes, this would be awesome. Note that right now the only available mechanism to get params from the URL is via the cloudshell_context query param which we pares via the --context flag: https://github.com/GoogleCloudPlatform/cloud-run-button/blob/c6f7e912d25884bec1b75ca79b91724be5ae13b6/cmd/cloudshell_open/main.go#L76

But the redirector can assemble something to pop into the cloudshell_context query param.

jamesward avatar Sep 23 '21 11:09 jamesward

We also have a way of specifying branches/tags/commits. If tags had dockerfiles with pre-populated RELEASE_TAG argument, it would also work.

ahmetb avatar Sep 23 '21 16:09 ahmetb