Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 3ea329b

Browse files
committed
Java8 example added to readme
1 parent b1959b5 commit 3ea329b

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,46 @@ curl http://ruby-test-25.default.dev.triggermesh.io
219219
{"statusCode":200,"body":"{\"date\":\"2019-01-14 19:10:29 +0000\"}"}
220220
```
221221

222+
#### Java8
223+
224+
1. Clone serverless [examples](https://github.com/serverless/examples) repository, change directory to `aws-java-simple-http-endpoint`, edit `serverless.yaml`:
225+
226+
```
227+
service: aws-java-sample
228+
description: Triggermesh Java8 sample
229+
provider:
230+
name: triggermesh
231+
functions:
232+
java-function:
233+
source: ../aws-java-simple-http-endpoint
234+
runtime: https://raw.githubusercontent.com/triggermesh/knative-lambda-runtime/master/java8/runtime.yaml
235+
buildargs:
236+
- HANDLER=com.serverless.Handler
237+
environment:
238+
EVENT_TYPE: "API_GATEWAY"
239+
```
240+
241+
2. Remove incompatible leftovers from `build.gradle` file:
242+
243+
```
244+
task wrapper(type: Wrapper) {
245+
gradleVersion = '3.2.1'
246+
}
247+
```
248+
249+
3. Deploy:
250+
251+
```
252+
tm deploy
253+
```
254+
255+
Function is ready:
256+
257+
```
258+
curl http://aws-java-sample-java-function.default.dev.triggermesh.io -d '{"event":"foo"}'
259+
{"message":"Hello, the current time is Tue Apr 07 13:59:17 GMT 2020"}
260+
```
261+
222262
### Support
223263

224264
We would love your feedback on this tool so don't hesitate to let us know what is wrong and how we could improve it, just file an [issue](https://github.com/triggermesh/knative-lambda-runtime/issues/new)

java8/runtime.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ spec:
4747
4848
4949
FROM gcr.io/triggermesh/knative-lambda-java8
50-
COPY --from=0 /app/build/docker /var/task
50+
COPY --from=0 /app/build/distributions/*.zip /var/task
51+
RUN unzip /var/task/*.zip
5152
5253
CMD ["$(inputs.params.HANDLER)"]
5354
EOF

0 commit comments

Comments
 (0)