Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 945 Bytes

README.md

File metadata and controls

39 lines (25 loc) · 945 Bytes

Example Java Functions: Fn Gradle + FDK for Java

This example shows you how to build a Java function by using a Dockerfile.

Key points:

  • Dockerfile - contains the containerized Docker build (based on dockerhub library/gradle images) and image build - this includes the gradle invocation
  • The cacheDeps task in build.gradle pulls down dependencies into the container gradle cache to speed up docker builds.
  • The copyDeps task in build.gradle copies the functions compile deps.
  • This uses JDK 11 by default

Step by step

Ensure you have the Fn server running to host your function:

(1) Start the server

$ fn start

(2) Create an app for the function

$ fn create app gradle-build-app

(3) Deploy the function to your app from the gradle-build directory.

fn deploy --app gradle-build-app --local

(4) Invoke the function

fn invoke gradle-build-app gradle_build