GCP displays the version number of a deployed cloud function in the console. At the moment there isn\'t a system environment variable which contains information about the de
There is no straightforward way to get the version number of a function at runtime. You always have the option of assigning some value yourself and put it in an environment variable using the --set-env-vars flag in gcloud.
If your goal is to figure out if a function invocation is actually running the code you just deployed while iterating during development, it's effective to simply console.log('deployed')
at the global scope of your function. The message will appear in the console logs after the deployment is complete, and you can wait for that message to appear in the log in order to know when your new code is active. Everything logged after that log should be from your latest code.