This is an automated email from the ASF dual-hosted git repository.
git-site-role pushed a commit to branch asf-site
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 277a0ca Automatic Site Publish by Jenkins
277a0ca is described below
commit 277a0ca9489463f74eb587d812cd0385c9228760
Author: jenkins <[email protected]>
AuthorDate: Wed Aug 8 20:01:51 2018 +0000
Automatic Site Publish by Jenkins
---
code/Hello.java | 19 +++++++++++++++++++
code/hello-with-params.js | 3 +++
code/hello.go | 25 +++++++++++++++++++++++++
code/hello.js | 3 +++
code/hello.php | 8 ++++++++
code/hello.py | 8 ++++++++
code/manifest-for-helloJS-1.yaml | 5 +++++
code/manifest-for-helloJS-2.yaml | 10 ++++++++++
code/manifest-for-helloPhp-1.yaml | 5 +++++
code/manifest-for-helloPhp-2.yaml | 14 ++++++++++++++
code/manifest-for-helloPy-1.yaml | 5 +++++
code/manifest-for-helloPy-2.yaml | 15 +++++++++++++++
feed.xml | 2 +-
13 files changed, 121 insertions(+), 1 deletion(-)
diff --git a/code/Hello.java b/code/Hello.java
new file mode 100644
index 0000000..516c1d0
--- /dev/null
+++ b/code/Hello.java
@@ -0,0 +1,19 @@
+package hello;
+
+import com.google.gson.JsonObject;
+
+public class Hello {
+ public static JsonObject main(JsonObject args)
+ String name;
+
+ try {
+ name = args.getAsJsonPrimitive("name").getAsString();
+ } catch(Exception e) {
+ name = "stranger";
+ }
+
+ JsonObject response = new JsonObject();
+ response.addProperty("greeting", "Hello " + name + "!");
+ return response;
+ }
+}
diff --git a/code/hello-with-params.js b/code/hello-with-params.js
new file mode 100644
index 0000000..6fb00e3
--- /dev/null
+++ b/code/hello-with-params.js
@@ -0,0 +1,3 @@
+function main(params) {
+ return {payload: 'Hello, ' + params.name + ' from ' + params.place};
+}
diff --git a/code/hello.go b/code/hello.go
new file mode 100644
index 0000000..149c22b
--- /dev/null
+++ b/code/hello.go
@@ -0,0 +1,25 @@
+package main
+
+import "encoding/json"
+import "fmt"
+import "os"
+
+func main() {
+ //program receives one argument: the JSON object as a string
+ arg := os.Args[1]
+
+ // unmarshal the string to a JSON object
+ var obj map[string]interface{}
+ json.Unmarshal([]byte(arg), &obj)
+
+ // can optionally log to stdout (or stderr)
+ fmt.Println("hello Go action")
+
+ name, ok := obj["name"].(string)
+ if !ok { name = "Stranger" }
+
+ // last line of stdout is the result JSON object as a string
+ msg := map[string]string{"msg": ("Hello, " + name + "!")}
+ res, _ := json.Marshal(msg)
+ fmt.Println(string(res))
+}
diff --git a/code/hello.js b/code/hello.js
new file mode 100644
index 0000000..685fd4e
--- /dev/null
+++ b/code/hello.js
@@ -0,0 +1,3 @@
+function main() {
+ return {payload: 'Hello world'};
+}
diff --git a/code/hello.php b/code/hello.php
new file mode 100644
index 0000000..ce75126
--- /dev/null
+++ b/code/hello.php
@@ -0,0 +1,8 @@
+<?php
+function main(array $args) : array
+{
+ $name = $args["name"] ?? "stranger";
+ $greeting = "Hello $name!";
+ echo $greeting;
+ return ["greeting" => $greeting];
+}
diff --git a/code/hello.py b/code/hello.py
new file mode 100644
index 0000000..eb436b7
--- /dev/null
+++ b/code/hello.py
@@ -0,0 +1,8 @@
+def main(dict):
+ if 'name' in dict:
+ name = dict['name']
+ else:
+ name = "stranger"
+ greeting = "Hello " + name + "!"
+ print(greeting)
+ return {"greeting": greeting}
diff --git a/code/manifest-for-helloJS-1.yaml b/code/manifest-for-helloJS-1.yaml
new file mode 100644
index 0000000..c5a2d5a
--- /dev/null
+++ b/code/manifest-for-helloJS-1.yaml
@@ -0,0 +1,5 @@
+packages:
+ default:
+ actions:
+ helloJS:
+ function: hello.js
diff --git a/code/manifest-for-helloJS-2.yaml b/code/manifest-for-helloJS-2.yaml
new file mode 100644
index 0000000..e01efb1
--- /dev/null
+++ b/code/manifest-for-helloJS-2.yaml
@@ -0,0 +1,10 @@
+packages:
+ default:
+ actions:
+ helloJS:
+ code: |
+ function main() {
+ return {payload: 'Hello world'};
+ }
+ runtime: nodejs:6
+
diff --git a/code/manifest-for-helloPhp-1.yaml
b/code/manifest-for-helloPhp-1.yaml
new file mode 100644
index 0000000..aa84921
--- /dev/null
+++ b/code/manifest-for-helloPhp-1.yaml
@@ -0,0 +1,5 @@
+packages:
+ default:
+ actions:
+ helloPHP:
+ function: hello.php
diff --git a/code/manifest-for-helloPhp-2.yaml
b/code/manifest-for-helloPhp-2.yaml
new file mode 100644
index 0000000..55d2e2e
--- /dev/null
+++ b/code/manifest-for-helloPhp-2.yaml
@@ -0,0 +1,14 @@
+packages:
+ default:
+ actions:
+ helloPHP:
+ code: |
+ <?php
+ function main(array $args) : array
+ {
+ $name = $args["name"] ?? "stranger";
+ $greeting = "Hello $name!";
+ echo $greeting;
+ return ["greeting" => $greeting];
+ }
+ runtime: php:7.1
diff --git a/code/manifest-for-helloPy-1.yaml b/code/manifest-for-helloPy-1.yaml
new file mode 100644
index 0000000..baf767b
--- /dev/null
+++ b/code/manifest-for-helloPy-1.yaml
@@ -0,0 +1,5 @@
+packages:
+ default:
+ actions:
+ helloPy:
+ function: hello.py
diff --git a/code/manifest-for-helloPy-2.yaml b/code/manifest-for-helloPy-2.yaml
new file mode 100644
index 0000000..ed10e9f
--- /dev/null
+++ b/code/manifest-for-helloPy-2.yaml
@@ -0,0 +1,15 @@
+packages:
+ default:
+ actions:
+ helloPy:
+ code: |
+ import sys
+ def main(dict):
+ if 'name' in dict:
+ name = dict['name']
+ else:
+ name = "stranger"
+ greeting = "Hello " + name + "!"
+ print(greeting)
+ return {"greeting": greeting}
+ runtime: python:2
diff --git a/feed.xml b/feed.xml
index 26fc5c0..3a9e6e8 100644
--- a/feed.xml
+++ b/feed.xml
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="utf-8"?><feed
xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/"
version="3.3.0">Jekyll</generator><link href="/feed.xml" rel="self"
type="application/atom+xml" /><link href="/" rel="alternate" type="text/html"
/><updated>2018-08-07T19:00:26+00:00</updated><id>/</id><title
type="html">Apache OpenWhisk is a serverless, open source cloud
platform</title><subtitle>An open source platform for serverless, event-driven
code at any scale. W [...]
+<?xml version="1.0" encoding="utf-8"?><feed
xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/"
version="3.3.0">Jekyll</generator><link href="/feed.xml" rel="self"
type="application/atom+xml" /><link href="/" rel="alternate" type="text/html"
/><updated>2018-08-08T20:01:47+00:00</updated><id>/</id><title
type="html">Apache OpenWhisk is a serverless, open source cloud
platform</title><subtitle>An open source platform for serverless, event-driven
code at any scale. W [...]
</subtitle></feed>
\ No newline at end of file