First build the function with:
$ ./gradlew clean shadowJar
Then cd
into the build/libs
directory (deployment has to be done from the location where the JAR lives):
$ cd build/libs
Now run:
$ gcloud functions deploy gcp-function --entry-point com.moorej.Function --runtime java11 --trigger-http
Choose unauthenticated access if you don't need auth.
To obtain the trigger URL do the following:
$ YOUR_HTTP_TRIGGER_URL=$(gcloud functions describe gcp-function --format='value(httpsTrigger.url)')
You can then use this variable to test the function invocation:
$ curl -i $YOUR_HTTP_TRIGGER_URL/gcpFunction