You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2019/12/19 23:12:24 UTC
[openwhisk-catalog] branch master updated: port websocket package
to nodejs:10 (#315)
This is an automated email from the ASF dual-hosted git repository.
rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-catalog.git
The following commit(s) were added to refs/heads/master by this push:
new 14451a2 port websocket package to nodejs:10 (#315)
14451a2 is described below
commit 14451a275fda747b4766f46f58c600fdd4ccb6c8
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Thu Dec 19 18:12:15 2019 -0500
port websocket package to nodejs:10 (#315)
add package/build logic to enable websockets package to use nodejs:10
runtime kind (which unlike nodejs:6 does not bundle the ws package)
---
packages/installCatalogUsingWskdeploy.sh | 4 ++++
packages/websocket/.gitignore | 3 +++
packages/websocket/build.sh | 20 ++++++++++++++++++++
packages/websocket/manifest.yaml | 4 ++--
packages/websocket/package.json | 6 ++++++
packages/websocket/sendWebSocketMessageAction.js | 2 ++
6 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/packages/installCatalogUsingWskdeploy.sh b/packages/installCatalogUsingWskdeploy.sh
index e53e017..b13ea6c 100755
--- a/packages/installCatalogUsingWskdeploy.sh
+++ b/packages/installCatalogUsingWskdeploy.sh
@@ -31,6 +31,10 @@ source "$SCRIPTDIR/validateParameter.sh" $1 $2 $3
source "$SCRIPTDIR/util.sh"
+echo building OpenWhisk packages
+
+pushd "$SCRIPTDIR/websocket/" && ./build.sh && popd
+
echo Installing OpenWhisk packages
deployProject "$SCRIPTDIR/github/"
diff --git a/packages/websocket/.gitignore b/packages/websocket/.gitignore
new file mode 100644
index 0000000..9bca7f2
--- /dev/null
+++ b/packages/websocket/.gitignore
@@ -0,0 +1,3 @@
+send.zip
+package-lock.json
+
diff --git a/packages/websocket/build.sh b/packages/websocket/build.sh
new file mode 100755
index 0000000..b033347
--- /dev/null
+++ b/packages/websocket/build.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# 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.
+#
+
+npm install
+zip -r send.zip *
diff --git a/packages/websocket/manifest.yaml b/packages/websocket/manifest.yaml
index 990b0e6..9043e70 100644
--- a/packages/websocket/manifest.yaml
+++ b/packages/websocket/manifest.yaml
@@ -33,8 +33,8 @@ project:
actions:
send:
version: 0.0.1
- function: sendWebSocketMessageAction.js
- runtime: nodejs:6
+ function: send.zip
+ runtime: nodejs:default
annotations:
description: "Send a message to a WebSocket"
parameters: [
diff --git a/packages/websocket/package.json b/packages/websocket/package.json
new file mode 100644
index 0000000..a4aa95e
--- /dev/null
+++ b/packages/websocket/package.json
@@ -0,0 +1,6 @@
+{
+ "main": "sendWebSocketMessageAction.js",
+ "dependencies": {
+ "ws": "7.2.1"
+ }
+}
diff --git a/packages/websocket/sendWebSocketMessageAction.js b/packages/websocket/sendWebSocketMessageAction.js
index 3e25feb..9b26873 100644
--- a/packages/websocket/sendWebSocketMessageAction.js
+++ b/packages/websocket/sendWebSocketMessageAction.js
@@ -79,3 +79,5 @@ function main(params) {
return promise;
}
+
+exports.main = main;