You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2018/05/24 18:44:04 UTC

[incubator-openwhisk-wskdeploy] branch master updated (57c1227 -> 753cd11)

This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git.


    from 57c1227  Remove the redundant packages from the release artifacts (#934)
     new 137956c  replacing cat with a simple helloworld example
     new 8c18e4e  adding action file
     new 753cd11  fixing zip action

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/integration/zipaction/actions/cat/index.js |  8 ---
 .../zipaction/actions/cat/node_modules/.bin/cat    |  1 -
 .../actions/cat/node_modules/cat/README.md         | 43 -------------
 .../zipaction/actions/cat/node_modules/cat/bin.js  | 16 -----
 .../actions/cat/node_modules/cat/example.js        |  8 ---
 .../actions/cat/node_modules/cat/index.js          | 57 -----------------
 .../actions/cat/node_modules/cat/package.json      | 74 ----------------------
 .../integration/zipaction/actions/cat/package.json |  7 --
 .../actions/greeting/index.js}                     |  1 +
 .../zipaction/actions/greeting/package.json        |  6 ++
 tests/src/integration/zipaction/deployment.yml     | 16 ++---
 tests/src/integration/zipaction/manifest.yml       | 26 ++++----
 12 files changed, 28 insertions(+), 235 deletions(-)
 delete mode 100644 tests/src/integration/zipaction/actions/cat/index.js
 delete mode 120000 tests/src/integration/zipaction/actions/cat/node_modules/.bin/cat
 delete mode 100644 tests/src/integration/zipaction/actions/cat/node_modules/cat/README.md
 delete mode 100755 tests/src/integration/zipaction/actions/cat/node_modules/cat/bin.js
 delete mode 100644 tests/src/integration/zipaction/actions/cat/node_modules/cat/example.js
 delete mode 100644 tests/src/integration/zipaction/actions/cat/node_modules/cat/index.js
 delete mode 100644 tests/src/integration/zipaction/actions/cat/node_modules/cat/package.json
 delete mode 100644 tests/src/integration/zipaction/actions/cat/package.json
 copy tests/src/integration/{apigateway/src/greeting.js => zipaction/actions/greeting/index.js} (95%)
 create mode 100644 tests/src/integration/zipaction/actions/greeting/package.json

-- 
To stop receiving notification emails like this one, please contact
houshengbo@apache.org.

[incubator-openwhisk-wskdeploy] 02/03: adding action file

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git

commit 8c18e4edfcd57debbfa12d0c36c8dc4526144302
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Thu May 24 10:20:49 2018 -0700

    adding action file
---
 .../integration/zipaction/actions/greeting/greeting.js    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/src/integration/zipaction/actions/greeting/greeting.js b/tests/src/integration/zipaction/actions/greeting/greeting.js
new file mode 100644
index 0000000..b846691
--- /dev/null
+++ b/tests/src/integration/zipaction/actions/greeting/greeting.js
@@ -0,0 +1,15 @@
+// Licensed to the Apache Software Foundation (ASF) under one or more contributor
+// license agreements; and to You under the Apache License, Version 2.0.
+
+/**
+ * Return a simple greeting message for someone.
+ *
+ * @param name A person's name.
+ * @param place Where the person is from.
+ */
+function main(params) {
+    var name = params.name || params.payload || 'stranger';
+    var place = params.place || 'somewhere';
+    return {payload:  'Hello, ' + name + ' from ' + place + '!'};
+}
+

-- 
To stop receiving notification emails like this one, please contact
houshengbo@apache.org.

[incubator-openwhisk-wskdeploy] 01/03: replacing cat with a simple helloworld example

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git

commit 137956c9011fa4ec6244883df70aa8f99b3ca4a8
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Thu May 24 10:18:38 2018 -0700

    replacing cat with a simple helloworld example
---
 .../src/integration/zipaction/actions/cat/index.js |  8 ---
 .../zipaction/actions/cat/node_modules/.bin/cat    |  1 -
 .../actions/cat/node_modules/cat/README.md         | 43 -------------
 .../zipaction/actions/cat/node_modules/cat/bin.js  | 16 -----
 .../actions/cat/node_modules/cat/example.js        |  8 ---
 .../actions/cat/node_modules/cat/index.js          | 57 -----------------
 .../actions/cat/node_modules/cat/package.json      | 74 ----------------------
 .../integration/zipaction/actions/cat/package.json |  7 --
 tests/src/integration/zipaction/manifest.yml       |  2 +-
 9 files changed, 1 insertion(+), 215 deletions(-)

diff --git a/tests/src/integration/zipaction/actions/cat/index.js b/tests/src/integration/zipaction/actions/cat/index.js
deleted file mode 100644
index 89d0f48..0000000
--- a/tests/src/integration/zipaction/actions/cat/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-function myAction(args) {
-    var cat = require('cat');
-    cat('https://baidu.com', console.log);
-}
-exports.main = myAction;
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/.bin/cat b/tests/src/integration/zipaction/actions/cat/node_modules/.bin/cat
deleted file mode 120000
index a618fc3..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/.bin/cat
+++ /dev/null
@@ -1 +0,0 @@
-../cat/bin.js
\ No newline at end of file
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/cat/README.md b/tests/src/integration/zipaction/actions/cat/node_modules/cat/README.md
deleted file mode 100644
index 71e3a96..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/cat/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
--->
-
-# cat
-
-cat will read the contents of an url. it's available through npm
-
-    npm install cat
-
-it will read your files
-
-```js
-var cat = require('cat');
-
-cat('myfile.txt', console.log);             // reads the file as utf-8 and returns it output
-cat('file://myfile.txt', console.log);      // same as above
-```
-
-and your `http` / `https` urls
-
-```js
-cat('http://google.com', console.log);      // cat also follows any redirects
-cat('https://github.com', console.log);     // and cat read https
-cat('http://fail.google.com', console.log); // if a status code != 2xx is received it will
-                                            // call the callback with an error.
-
-```
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/cat/bin.js b/tests/src/integration/zipaction/actions/cat/node_modules/cat/bin.js
deleted file mode 100755
index 697d1f6..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/cat/bin.js
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env node
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-var fs = require('fs')
-
-var input = process.argv.slice(2)
-
-var loop = function() {
-  if (!input.length) return
-  var next = input.shift()
-  var s = next === '-' ? process.stdin : fs.createReadStream(next)
-  s.on('end', loop).pipe(process.stdout)
-}
-
-loop()
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/cat/example.js b/tests/src/integration/zipaction/actions/cat/node_modules/cat/example.js
deleted file mode 100644
index 4a6e857..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/cat/example.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-var cat = require('./index');
-
-cat(__filename, console.log);
-
-cat('https://raw.github.com/mafintosh/cat/master/example.js', console.log);
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/cat/index.js b/tests/src/integration/zipaction/actions/cat/node_modules/cat/index.js
deleted file mode 100644
index 49f2e48..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/cat/index.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one or more contributor
-// license agreements; and to You under the Apache License, Version 2.0.
-
-var fs = require('fs');
-var parse = require('url').parse;
-
-var catter = function(lib) {
-    var cat = function(url, callback) {
-        if (typeof url === 'string') {
-            url = parse(url);
-        }
-        lib.get({host:url.hostname, port:url.port, path:url.pathname}, function(response) {
-            if (/3\d\d/.test(response.statusCode) && response.headers.location) {
-                cat(parse(response.headers.location), callback);
-                return;
-            }
-            if (!(/2\d\d/).test(response.statusCode)) {
-                callback(new Error('non 2xx status code: ' + response.statusCode));
-                return;
-            }
-            var buffer = '';
-
-            response.setEncoding('utf-8');
-            response.on('data', function(data) {
-                buffer += data;
-            });
-            response.on('close', function() {
-                callback(new Error('unexpected close of response'));
-            });
-            response.on('end', function() {
-                callback(null, buffer);
-            });
-        }).on('error', callback);
-    };
-    return cat;
-};
-
-var http = catter(require('http'));
-var https = catter(require('https'));
-
-module.exports = function(location, callback) {
-    var protocol = (location.match(/^(\w+):\/\//) || [])[1] || 'file';
-
-    if (protocol === 'file') {
-        fs.readFile(location.replace(/^(file:\/\/localhost|file:\/\/)/, ''), 'utf-8', callback);
-        return;
-    }
-    if (protocol === 'http') {
-        http(location, callback);
-        return;
-    }
-    if (protocol === 'https') {
-        https(location, callback);
-        return;
-    }
-    throw new Error('protocol '+protocol+' currently not supported :(');
-};
diff --git a/tests/src/integration/zipaction/actions/cat/node_modules/cat/package.json b/tests/src/integration/zipaction/actions/cat/node_modules/cat/package.json
deleted file mode 100644
index 355bc25..0000000
--- a/tests/src/integration/zipaction/actions/cat/node_modules/cat/package.json
+++ /dev/null
@@ -1,74 +0,0 @@
-{
-  "_args": [
-    [
-      {
-        "raw": "cat@0.2.0",
-        "scope": null,
-        "escapedName": "cat",
-        "name": "cat",
-        "rawSpec": "0.2.0",
-        "spec": "0.2.0",
-        "type": "version"
-      },
-      "/Users/dliu/go_work/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/zipaction/actions/cat"
-    ]
-  ],
-  "_from": "cat@0.2.0",
-  "_id": "cat@0.2.0",
-  "_inCache": true,
-  "_location": "/cat",
-  "_npmUser": {
-    "name": "mafintosh",
-    "email": "mathiasbuus@gmail.com"
-  },
-  "_npmVersion": "1.4.9",
-  "_phantomChildren": {},
-  "_requested": {
-    "raw": "cat@0.2.0",
-    "scope": null,
-    "escapedName": "cat",
-    "name": "cat",
-    "rawSpec": "0.2.0",
-    "spec": "0.2.0",
-    "type": "version"
-  },
-  "_requiredBy": [
-    "/"
-  ],
-  "_resolved": "https://registry.npmjs.org/cat/-/cat-0.2.0.tgz",
-  "_shasum": "fd850cda7d4162e6904f33b7fcf743b1243fd434",
-  "_shrinkwrap": null,
-  "_spec": "cat@0.2.0",
-  "_where": "/Users/dliu/go_work/src/github.com/apache/incubator-openwhisk-wskdeploy/tests/src/integration/zipaction/actions/cat",
-  "author": {
-    "name": "Mathias Buus Madsen",
-    "email": "mathiasbuus@gmail.com"
-  },
-  "bin": {
-    "cat": "bin.js"
-  },
-  "dependencies": {},
-  "description": "cat will read the contents of an url",
-  "devDependencies": {},
-  "directories": {},
-  "dist": {
-    "shasum": "fd850cda7d4162e6904f33b7fcf743b1243fd434",
-    "tarball": "https://registry.npmjs.org/cat/-/cat-0.2.0.tgz"
-  },
-  "homepage": "https://github.com/mafintosh/cat",
-  "keywords": [
-    "cat",
-    "util",
-    "request"
-  ],
-  "maintainers": [
-    {
-      "name": "mafintosh",
-      "email": "m@ge.tt"
-    }
-  ],
-  "name": "cat",
-  "optionalDependencies": {},
-  "readme": "ERROR: No README data found!",
-  "version": "0.2.0"
-}
diff --git a/tests/src/integration/zipaction/actions/cat/package.json b/tests/src/integration/zipaction/actions/cat/package.json
deleted file mode 100644
index 6328214..0000000
--- a/tests/src/integration/zipaction/actions/cat/package.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  "name": "my-action",
-  "main": "index.js",
-  "dependencies" : {
-    "cat" : "0.2.0"
-  }
-}
diff --git a/tests/src/integration/zipaction/manifest.yml b/tests/src/integration/zipaction/manifest.yml
index 59104f8..ae687b5 100644
--- a/tests/src/integration/zipaction/manifest.yml
+++ b/tests/src/integration/zipaction/manifest.yml
@@ -8,7 +8,7 @@ packages:
       actions:
         cat:
           version: 1.0
-          function: actions/cat
+          function: actions/greeting
           runtime: nodejs:6
           inputs:
             name: string

-- 
To stop receiving notification emails like this one, please contact
houshengbo@apache.org.

[incubator-openwhisk-wskdeploy] 03/03: fixing zip action

Posted by ho...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-wskdeploy.git

commit 753cd1103e9158579a96c9599a07551a039731f5
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Thu May 24 10:47:43 2018 -0700

    fixing zip action
---
 .../actions/greeting/{greeting.js => index.js}     |  1 +
 .../zipaction/actions/greeting/package.json        |  6 +++++
 tests/src/integration/zipaction/deployment.yml     | 16 ++++++-------
 tests/src/integration/zipaction/manifest.yml       | 26 +++++++++++-----------
 4 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/tests/src/integration/zipaction/actions/greeting/greeting.js b/tests/src/integration/zipaction/actions/greeting/index.js
similarity index 95%
rename from tests/src/integration/zipaction/actions/greeting/greeting.js
rename to tests/src/integration/zipaction/actions/greeting/index.js
index b846691..38c3ad8 100644
--- a/tests/src/integration/zipaction/actions/greeting/greeting.js
+++ b/tests/src/integration/zipaction/actions/greeting/index.js
@@ -12,4 +12,5 @@ function main(params) {
     var place = params.place || 'somewhere';
     return {payload:  'Hello, ' + name + ' from ' + place + '!'};
 }
+exports.main = main;
 
diff --git a/tests/src/integration/zipaction/actions/greeting/package.json b/tests/src/integration/zipaction/actions/greeting/package.json
new file mode 100644
index 0000000..80cb6cd
--- /dev/null
+++ b/tests/src/integration/zipaction/actions/greeting/package.json
@@ -0,0 +1,6 @@
+{
+   "name": "my-action",
+   "main": "index.js",
+   "dependencies" : {
+   }
+}
diff --git a/tests/src/integration/zipaction/deployment.yml b/tests/src/integration/zipaction/deployment.yml
index 99a65bc..55a48a6 100644
--- a/tests/src/integration/zipaction/deployment.yml
+++ b/tests/src/integration/zipaction/deployment.yml
@@ -2,11 +2,11 @@
 # license agreements; and to You under the Apache License, Version 2.0.
 
 project:
-  name: wskdeploy-samples
-  packages:
-    zipaction:
-      actions:
-        cat:
-          inputs:
-            name: Bernie
-            place: Vermont
+    name: wskdeploy-samples
+    packages:
+        zipaction:
+            actions:
+                greeting:
+                    inputs:
+                        name: Bernie
+                        place: Vermont
diff --git a/tests/src/integration/zipaction/manifest.yml b/tests/src/integration/zipaction/manifest.yml
index ae687b5..de0bf94 100644
--- a/tests/src/integration/zipaction/manifest.yml
+++ b/tests/src/integration/zipaction/manifest.yml
@@ -2,16 +2,16 @@
 # license agreements; and to You under the Apache License, Version 2.0.
 
 packages:
-  zipaction:
-      version: 1.0
-      license: Apache-2.0
-      actions:
-        cat:
-          version: 1.0
-          function: actions/greeting
-          runtime: nodejs:6
-          inputs:
-            name: string
-            place: string
-          outputs:
-            payload: string
+    zipaction:
+        version: 1.0
+        license: Apache-2.0
+        actions:
+            greeting:
+                version: 1.0
+                function: actions/greeting
+                runtime: nodejs:6
+                inputs:
+                    name: string
+                    place: string
+                outputs:
+                    payload: string

-- 
To stop receiving notification emails like this one, please contact
houshengbo@apache.org.