Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small improvements to the Google Cloud Function guides #44353

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/src/main/asciidoc/funqy-gcp-functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ You will have a single JAR inside the `target/deployment` repository that contai
Then you will be able to use `gcloud` to deploy your function to Google Cloud.
The `gcloud` command will be different depending on which event triggers your function.

NOTE: We will use the Java 17 runtime but you can switch to the Java 21 runtime by using `--runtime=java21` instead of `--runtime=java17` on the deploy commands.
NOTE: We will use the Java 21 runtime, but you can switch to the Java 17 runtime by using `--runtime=java17` instead of `--runtime=java21` on the deploy commands.

[WARNING]
====
Expand All @@ -168,7 +168,7 @@ Use this command to deploy to Google Cloud Functions:
----
gcloud functions deploy quarkus-example-funky-pubsub \
--entry-point=io.quarkus.funqy.gcp.functions.FunqyBackgroundFunction \
--runtime=java17 --trigger-resource hello_topic --trigger-event google.pubsub.topic.publish \
--runtime=java21 --trigger-resource hello_topic --trigger-event google.pubsub.topic.publish \
--source=target/deployment
----

Expand Down Expand Up @@ -205,7 +205,7 @@ Then, use this command to deploy to Google Cloud Functions:
----
gcloud functions deploy quarkus-example-funky-storage \
--entry-point=io.quarkus.funqy.gcp.functions.FunqyBackgroundFunction \
--runtime=java17 --trigger-resource quarkus-hello --trigger-event google.storage.object.finalize \
--runtime=java21 --trigger-resource quarkus-hello --trigger-event google.storage.object.finalize \
--source=target/deployment
----

Expand Down Expand Up @@ -246,7 +246,7 @@ Then, use this command to deploy to Google Cloud Functions:
----
gcloud functions deploy quarkus-example-cloud-event --gen2 \
--entry-point=io.quarkus.funqy.gcp.functions.FunqyCloudEventsFunction \
--runtime=java17 --trigger-bucket=example-cloud-event --source=target/deployment
--runtime=java21 --trigger-bucket=example-cloud-event --source=target/deployment
----

[IMPORTANT]
Expand Down Expand Up @@ -371,7 +371,7 @@ This will call your cloud events function with an event on the `"MY_FILE.txt` fi

Quarkus provides built-in support for testing your Funqy Google Cloud functions via the `quarkus-test-google-cloud-functions` dependency.

To use it, you must add the following test dependency in your `pom.xml`.
To use it, you must add the following test dependencies in your `pom.xml`.

[source,xml]
----
Expand All @@ -380,6 +380,11 @@ To use it, you must add the following test dependency in your `pom.xml`.
<artifactId>quarkus-test-google-cloud-functions</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
----

This extension provides a `@WithFunction` annotation that can be used to annotate `@QuarkusTest` test cases to start a Cloud Function invoker before you test cases and stop it at the end.
Expand Down
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/gcp-functions-http.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ The result of the previous command is a single JAR file inside the `target/deplo

Then you will be able to use `gcloud` to deploy your function to Google Cloud.

NOTE: We will use the Java 17 runtime but you can switch to the Java 21 runtime by using `--runtime=java21` instead of `--runtime=java17` on the deploy commands.
NOTE: We will use the Java 21 runtime, but you can switch to the Java 17 runtime by using `--runtime=java17` instead of `--runtime=java21` on the deploy commands.

[source,bash]
----
gcloud functions deploy quarkus-example-http \
--entry-point=io.quarkus.gcp.functions.http.QuarkusHttpFunction \
--runtime=java17 --trigger-http --allow-unauthenticated --source=target/deployment
--runtime=java21 --trigger-http --allow-unauthenticated --source=target/deployment
----

[IMPORTANT]
Expand Down
15 changes: 10 additions & 5 deletions docs/src/main/asciidoc/gcp-functions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ The result of the previous command is a single JAR file inside the `target/deplo
Then you will be able to use `gcloud` to deploy your function to Google Cloud.
The `gcloud` command will be different depending on which event triggers your function.

NOTE: We will use the Java 17 runtime but you can switch to the Java 21 runtime by using `--runtime=java21` instead of `--runtime=java17` on the deploy commands.
NOTE: We will use the Java 21 runtime but you can switch to the Java 17 runtime by using `--runtime=java17` instead of `--runtime=java21` on the deploy commands.

[WARNING]
====
Expand All @@ -262,7 +262,7 @@ This is an example command to deploy your `HttpFunction` to Google Cloud:
----
gcloud functions deploy quarkus-example-http \
--entry-point=io.quarkus.gcp.functions.QuarkusHttpFunction \
--runtime=java17 --trigger-http --allow-unauthenticated --source=target/deployment
--runtime=java21 --trigger-http --allow-unauthenticated --source=target/deployment
----

[IMPORTANT]
Expand All @@ -289,7 +289,7 @@ it needs to use `--trigger-event google.storage.object.finalize` and the `--trig
gcloud functions deploy quarkus-example-storage \
--entry-point=io.quarkus.gcp.functions.QuarkusBackgroundFunction \
--trigger-resource quarkus-hello --trigger-event google.storage.object.finalize \
--runtime=java17 --source=target/deployment
--runtime=java21 --source=target/deployment
----

[IMPORTANT]
Expand All @@ -315,7 +315,7 @@ it needs to use `--trigger-event google.pubsub.topic.publish` and the `--trigger
----
gcloud functions deploy quarkus-example-pubsub \
--entry-point=io.quarkus.gcp.functions.QuarkusBackgroundFunction \
--runtime=java17 --trigger-resource hello_topic --trigger-event google.pubsub.topic.publish --source=target/deployment
--runtime=java21 --trigger-resource hello_topic --trigger-event google.pubsub.topic.publish --source=target/deployment
----

[IMPORTANT]
Expand All @@ -341,7 +341,7 @@ it needs to use `--trigger-bucket` parameter with the name of a previously creat
----
gcloud functions deploy quarkus-example-cloud-event --gen2 \
--entry-point=io.quarkus.gcp.functions.QuarkusCloudEventsFunction \
--runtime=java17 --trigger-bucket=example-cloud-event --source=target/deployment
--runtime=java21 --trigger-bucket=example-cloud-event --source=target/deployment
----

[IMPORTANT]
Expand Down Expand Up @@ -485,6 +485,11 @@ To use it, you must add the following test dependency in your `pom.xml`.
<artifactId>quarkus-test-google-cloud-functions</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
----

This extension provides a `@WithFunction` annotation that can be used to annotate `@QuarkusTest` test cases to start a Cloud Function invoker before you test cases and stop it at the end.
Expand Down
Loading