Skip to content

Commit

Permalink
port websocket package to nodejs:10 (#315)
Browse files Browse the repository at this point in the history
add package/build logic to enable websockets package to use nodejs:10
runtime kind (which unlike nodejs:6 does not bundle the ws package)
  • Loading branch information
dgrove-oss authored and rabbah committed Dec 19, 2019
1 parent 6997e19 commit 14451a2
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/installCatalogUsingWskdeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
3 changes: 3 additions & 0 deletions packages/websocket/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
send.zip
package-lock.json

20 changes: 20 additions & 0 deletions packages/websocket/build.sh
Original file line number Diff line number Diff line change
@@ -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 *
4 changes: 2 additions & 2 deletions packages/websocket/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 6 additions & 0 deletions packages/websocket/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"main": "sendWebSocketMessageAction.js",
"dependencies": {
"ws": "7.2.1"
}
}
2 changes: 2 additions & 0 deletions packages/websocket/sendWebSocketMessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,5 @@ function main(params) {

return promise;
}

exports.main = main;

0 comments on commit 14451a2

Please sign in to comment.