Fix docs build
This commit is contained in:
@@ -6,10 +6,10 @@ image::https://travis-ci.org/spring-cloud/spring-cloud-function.svg?branch=maste
|
||||
|
||||
Spring Cloud Function is a project with the following high-level goals:
|
||||
|
||||
* _Promote the implementation of business logic via functions._
|
||||
* _Decouple the development lifecycle of business logic from any specific runtime target so that the same code can run as a web endpoint, a stream processor, or a task._
|
||||
* _Support a uniform programming model across serverless providers, as well as the ability to run standalone (locally or in a PaaS)._
|
||||
* _Enable Spring Boot features (auto-configuration, dependency injection, metrics) on serverless providers._
|
||||
* Promote the implementation of business logic via functions.
|
||||
* Decouple the development lifecycle of business logic from any specific runtime target so that the same code can run as a web endpoint, a stream processor, or a task.
|
||||
* Support a uniform programming model across serverless providers, as well as the ability to run standalone (locally or in a PaaS).
|
||||
* Enable Spring Boot features (auto-configuration, dependency injection, metrics) on serverless providers.
|
||||
|
||||
It abstracts away all of the transport details and
|
||||
infrastructure, allowing the developer to keep all the familiar tools
|
||||
|
||||
39
docs/pom.xml
39
docs/pom.xml
@@ -30,6 +30,9 @@
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>docs</id>
|
||||
<properties>
|
||||
<adapters.path>${main.basedir}/spring-cloud-function-adapters</adapters.path>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
@@ -46,11 +49,41 @@
|
||||
<groupId>com.agilejava.docbkx</groupId>
|
||||
<artifactId>docbkx-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<inherited>false</inherited>
|
||||
</plugin>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>adapters</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-aws/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/aws-readme.adoc"/>
|
||||
</java>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-azure/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/azure-readme.adoc"/>
|
||||
</java>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-openwhisk/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/openwhisk-readme.adoc"/>
|
||||
</java>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
|
||||
48
pom.xml
48
pom.xml
@@ -177,54 +177,6 @@
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>docs</id>
|
||||
<properties>
|
||||
<adapters.path>${main.basedir}/spring-cloud-function-adapters</adapters.path>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>adapters</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-aws/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/aws-readme.adoc"/>
|
||||
</java>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-azure/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/azure-readme.adoc"/>
|
||||
</java>
|
||||
<java classname="org.jruby.Main" failonerror="yes">
|
||||
<arg value="${docs.resources.dir}/ruby/generate_readme.sh"/>
|
||||
<arg value="-o"/>
|
||||
<arg value="${adapters.path}/spring-cloud-function-adapter-openwhisk/README.adoc"/>
|
||||
<arg value="${basedir}/src/main/asciidoc/adapters/openwhisk-readme.adoc"/>
|
||||
</java>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
|
||||
@@ -6,20 +6,18 @@ The adapter has a couple of generic request handlers that you can use. The most
|
||||
|
||||
If your app has more than one `@Bean` of type `Function` etc. then you can choose the one to use by configuring `function.name` (e.g. as `FUNCTION_NAME` environment variable in AWS). The functions are extracted from the Spring Cloud `FunctionCatalog` (searching first for `Function` then `Consumer` and finally `Supplier`).
|
||||
|
||||
=== Notes on JAR Layout
|
||||
== Notes on JAR Layout
|
||||
|
||||
You don't need the Spring Cloud Function Web or Stream adapter at runtime in Lambda, so you might need to exclude those before you create the JAR you send to AWS. A Lambda application has to be shaded, but a Spring Boot standalone application does not, so you can run the same app using 2 separate jars (as per the sample here). The sample app creates 2 jar files, one with an `aws` classifier for deploying in Lambda, and one executable (thin) jar that includes `spring-cloud-function-web` at runtime. Spring Cloud Function will try and locate a "main class" for you from the JAR file manifest, using the `Start-Class` attribute (which will be added for you by the Spring Boot tooling if you use the starter parent). If there is no `Start-Class` in your manifest you can use an environment variable `MAIN_CLASS` when you deploy the function to AWS.
|
||||
|
||||
== Build
|
||||
|
||||
----
|
||||
./mvnw -U clean package
|
||||
----
|
||||
You don't need the Spring Cloud Function Web or Stream adapter at runtime in Lambda, so you might need to exclude those before you create the JAR you send to AWS. A Lambda application has to be shaded, but a Spring Boot standalone application does not, so you can run the same app using 2 separate jars (as per the sample). The sample app creates 2 jar files, one with an `aws` classifier for deploying in Lambda, and one executable (thin) jar that includes `spring-cloud-function-web` at runtime. Spring Cloud Function will try and locate a "main class" for you from the JAR file manifest, using the `Start-Class` attribute (which will be added for you by the Spring Boot tooling if you use the starter parent). If there is no `Start-Class` in your manifest you can use an environment variable `MAIN_CLASS` when you deploy the function to AWS.
|
||||
|
||||
== Upload
|
||||
|
||||
Build the sample under `spring-cloud-function-samples/function-sample-aws` and upload the `-aws` jar file to Lambda. The handler can be `example.Handler` or `org.springframework.cloud.function.adapter.aws.SpringBootStreamHandler` (FQN of the class, _not_ a method reference, although Lambda does accept method references).
|
||||
|
||||
----
|
||||
./mvnw -U clean package
|
||||
----
|
||||
|
||||
Using the AWS command line tools it looks like this:
|
||||
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user