Looking for some clarification with `google_cloud_...
# general
d
Looking for some clarification with
google_cloud_function
targets. The docs state
You can use any of the various Google Cloud methods to upload your zip file, such as the Google Cloud console or the Google Cloud CLI.
the only way I’ve successfully managed to get this working is uploading this zip file to google cloud storage with
gcloud storage cp dist/functions.example/cloud_function.zip <gs://bucket>
then
gcloud functions deploy --source=<gs://bucket/cloud_function.zip>
But this requires you know the bucket/location upfront. So instead I’ve been unzipping the binary every time.
gcloud functions deploy test --source=dist/functions.example/cloud_function.zip
gives me a
Copy code
ERROR: (gcloud.functions.deploy) Invalid value for [--source]: Provided path does not point to a directory
Is it possible to do some sort of variant of
layout="loose"
in the
google_cloud_function
target (similar to
pex_binary
) So I can avoid having to unzip the pex?
b
It isn't currently, but it wouldn't be hard to add. Could you file a feature request issue? Would you be interested in implementing it?
d
Hi Huon, apologies for radio silence but I managed to hack on this today and worked out how to pass through the correct args: https://github.com/pantsbuild/pants/pull/20789 Have tested + been able to deploy the resulting dist output to GCF.
👍 1