You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2019/09/30 14:06:52 UTC

[openwhisk-catalog] branch master updated: remove non-wskdeploy based package installation scripts (#308)

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

dgrove 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 8a54065  remove non-wskdeploy based package installation scripts (#308)
8a54065 is described below

commit 8a54065cfe5090f1759342d4237e7a375fdc43a5
Author: David Grove <dg...@users.noreply.github.com>
AuthorDate: Mon Sep 30 10:06:47 2019 -0400

    remove non-wskdeploy based package installation scripts (#308)
    
    core project, deploy-kube, and devtools are now all using
    the wskdeploy-based script to install the catalog.
    Cleanup by removing the older and now unused scripts.
---
 README.md                    |   4 +-
 packages/installCatalog.sh   |  45 ----------------
 packages/installGit.sh       |  41 ---------------
 packages/installSlack.sh     |  41 ---------------
 packages/installSystem.sh    | 121 -------------------------------------------
 packages/installWeather.sh   |  43 ---------------
 packages/installWebSocket.sh |  53 -------------------
 packages/util.sh             |  52 -------------------
 8 files changed, 2 insertions(+), 398 deletions(-)

diff --git a/README.md b/README.md
index ca5e2ec..2148a35 100644
--- a/README.md
+++ b/README.md
@@ -39,10 +39,10 @@ for information about how to browse the catalog by using the command line tool.
 
 ### Install openwhisk-catalog
 
-We should be able to run the script [packages/installCatalog.sh](packages/installCatalog.sh) to install the catalog like:
+We should be able to run the script [packages/installCatalogUsingWskdeploy.sh](packages/installCatalogUsingWskdeploy.sh) to install the catalog like:
 
 ```
-./packages/installCatalog.sh [catalog_auth_key] [api_host] [cli_path]
+./packages/installCatalogUsingWskdeploy.sh [catalog_auth_key] [api_host] [cli_path]
 ```
 
 The first argument `catalog_auth_key`, defines the secret key used to authenticate the openwhisk
diff --git a/packages/installCatalog.sh b/packages/installCatalog.sh
deleted file mode 100755
index 230ef61..0000000
--- a/packages/installCatalog.sh
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/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.
-#
-# use the command line interface to install standard actions deployed
-# automatically
-#
-: ${OPENWHISK_HOME:?"OPENWHISK_HOME must be set and non-empty"}
-
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-OPENWHISK_HOME=${OPENWHISK_HOME:-$SCRIPTDIR/../../openwhisk}
-SKIP_DEPRECATED_PACKAGES=${SKIP_DEPRECATED_PACKAGES:="false"}
-
-source "$SCRIPTDIR/validateParameter.sh" $1 $2 $3
-: ${WHISK_SYSTEM_AUTH:?"WHISK_SYSTEM_AUTH is not configured. Please input the correctly parameter: CATALOG_AUTH_KEY"}
-: ${WHISK_API_HOST:?"WHISK_API_HOST is not configured. Please input the correctly parameter: API_HOST"}
-: ${WHISK_CLI_PATH:?"WHISK_CLI_PATH is not configured. Please input the correctly parameter: cli_path"}
-
-source "$SCRIPTDIR/util.sh"
-
-echo Installing OpenWhisk packages
-
-runPackageInstallScript "$SCRIPTDIR" installGit.sh
-runPackageInstallScript "$SCRIPTDIR" installSlack.sh
-runPackageInstallScript "$SCRIPTDIR" installSystem.sh
-runPackageInstallScript "$SCRIPTDIR" installWeather.sh
-runPackageInstallScript "$SCRIPTDIR" installWebSocket.sh
-
-waitForAll
-
-echo open catalog ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/installGit.sh b/packages/installGit.sh
deleted file mode 100755
index a364b1f..0000000
--- a/packages/installGit.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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.
-#
-# use the command line interface to install Git package.
-#
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-PACKAGE_HOME=$SCRIPTDIR
-source "$PACKAGE_HOME/util.sh"
-
-echo Installing Git package.
-
-createPackage github \
-    -a description "Package which contains actions and feeds to interact with Github"
-
-waitForAll
-
-install "$PACKAGE_HOME/github/webhook.js" \
-    github/webhook \
-    -a feed true \
-    -a description 'Creates a webhook on GitHub to be notified on selected changes' \
-    -a parameters '[ {"name":"username", "required":true, "bindTime":true, "description": "Your GitHub username"}, {"name":"repository", "required":true, "bindTime":true, "description": "The name of a GitHub repository"}, {"name":"accessToken", "required":true, "bindTime":true, "description": "A webhook or personal token", "doclink": "https://github.com/settings/tokens/new"},{"name":"events", "required":true, "description": "A comma-separated list", "doclink": "https://developer.github.c [...]
-    -a sampleInput '{"username":"myUserName", "repository":"myRepository or myOrganization/myRepository", "accessToken":"123ABCXYZ", "events": "push,delete,pull-request"}'
-
-waitForAll
-
-echo Git package ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/installSlack.sh b/packages/installSlack.sh
deleted file mode 100755
index ca52e44..0000000
--- a/packages/installSlack.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/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.
-#
-# use the command line interface to install Slack package.
-#
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-PACKAGE_HOME=$SCRIPTDIR
-source "$PACKAGE_HOME/util.sh"
-
-echo Installing Slack package.
-
-createPackage slack \
-    -a description "This package interacts with the Slack messaging service" \
-    -a parameters '[ {"name":"username", "required":true, "bindTime":true, "description": "Your Slack username"}, {"name":"url", "required":true, "bindTime":true, "description": "Your webhook URL", "doclink": "https://api.slack.com/incoming-webhooks"},{"name":"channel", "required":true, "bindTime":true, "description": "The name of a Slack channel"}, {"name": "token", "description": "Your Slack oauth token", "doclink": "https://api.slack.com/docs/oauth"} ]'
-
-waitForAll
-
-install "$PACKAGE_HOME/slack/post.js" \
-    slack/post \
-    -a description 'Post a message to Slack' \
-    -a parameters '[ {"name":"text", "required":true, "description": "The message you wish to post"} ]' \
-    -a sampleInput '{"username":"openwhisk", "text":"Hello OpenWhisk!", "channel":"myChannel", "url": "https://hooks.slack.com/services/XYZ/ABCDEFG/12345678"}'
-
-waitForAll
-
-echo Slack package ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/installSystem.sh b/packages/installSystem.sh
deleted file mode 100755
index 983facc..0000000
--- a/packages/installSystem.sh
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/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.
-#
-# use the command line interface to install standard actions deployed
-# automatically.
-#
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-PACKAGE_HOME=$SCRIPTDIR
-source "$PACKAGE_HOME/util.sh"
-
-echo Installing whisk.system entities.
-
-createPackage utils -a description "Building blocks that format and assemble data"
-createPackage samples -a description "A suite of simple actions to help you get started with OpenWhisk"
-
-waitForAll
-
-install "$PACKAGE_HOME/utils/echo.js" \
-    utils/echo \
-    -a description 'Returns the input' -a parameters '[{"name": "payload", "required":false, "description": "Any JSON entity"}]' \
-    -a sampleInput '{ "payload": "Five fuzzy felines"}' \
-    -a sampleOutput '{ "payload": "Five fuzzy felines"}'
-
-install "$PACKAGE_HOME/utils/cat.js" \
-     utils/cat \
-     -a description 'Concatenates input into a string' \
-     -a parameters '[ { "name": "lines", "required": true, "type": "array", "description": "An array of strings or numbers" } ]' \
-     -a sampleInput '{ "lines": [4, 2, 3] }' \
-     -a sampleOutput '{ "lines": [4, 2, 3] }'
-
-install "$PACKAGE_HOME/utils/smash.js" \
-     utils/smash \
-     -a description 'Nests all properties under given property.' \
-     -a parameters '[{"name": "$fieldName", "required":true, "type": "string", "description": "Name of property to nest object under" }]' \
-     -a sampleInput '{ "a": 1, "b": { "c": 2, "d": 3 }, "$fieldName": "p" }' \
-     -a sampleOutput '{ "p": { "a": 1, "b": { "c": 2, "d": 3 } } }'
-
-install "$PACKAGE_HOME/utils/split.js" \
-     utils/split \
-     -a description 'Split a string into an array' \
-     -a parameters '[{"name": "payload", "required":true, "description":"A string"}, { "name": "separator", "required": false, "description": "The character, or the regular expression, to use for splitting the string" }]' \
-     -a sampleInput '{ "payload": "one,two,three", "separator": "," }' \
-     -a sampleOutput '{ "lines": ["one", "two", "three"], "payload": "one,two,three"}'
-
-install "$PACKAGE_HOME/utils/sort.js" \
-     utils/sort \
-     -a description 'Sorts an array' \
-     -a parameters '[ { "name": "lines", "required": true, "type": "array", "description": "An array of strings" } ]' \
-     -a sampleInput '{ "lines": [4, 2, 3] }' \
-     -a sampleOutput '{ "lines": [2, 3, 4], "length": 3 }'
-
-install "$PACKAGE_HOME/utils/head.js" \
-     utils/head \
-     -a description 'Extract prefix of an array' \
-     -a parameters '[ { "name": "lines", "required": true, "type": "array", "description": "An array of strings" }, { "name": "num", "required": false, "type": "integer", "description": "The length of the prefix" }]' \
-     -a sampleInput '{ "lines": [4, 2, 3], "num": 2 }' \
-     -a sampleOutput '{ "lines": [4, 2], "num": 2 }'
-
-install "$PACKAGE_HOME/utils/date.js" \
-     utils/date \
-     -a description 'Current date and time' \
-     -a sampleOutput '{ "date": "2016-03-22T00:59:55.961Z" }'
-
-install "$PACKAGE_HOME/utils/namespace.js" \
-     utils/namespace \
-     -a description 'Returns namespace for the authorization key used to invoke this action' \
-     -a sampleOutput '{ "namespace": "guest" }'
-
-install "$PACKAGE_HOME/utils/hosturl.js" \
-     utils/hosturl \
-     -a description 'Returns the URL to activation an action or trigger' \
-     -a parameters '[ { "name": "web", "type": "boolean", "description": "True for web actions"}, { "name": "ext", "type": "string", "description": "Extension for web action, one of .html, .http, .json, .text" }, { "name": "trigger", "type": "boolean", "description": "True to construct path for trigger instead of action." }, { "name": "path", "type": "string", "description": "The action name as just <action name> or <package name>/<action name>." } ]' \
-     -a sampleInput '{ "web": true, "path": "utils/echo" }' \
-     -a sampleOutput '{ "url": "https://openwhisk.ng.bluemix.net/api/v1/experimental/web/guest/utils/echo.json" }'
-
-install "$PACKAGE_HOME/samples/hello/javascript/hello.js" \
-     samples/helloWorld \
-     -a description 'Demonstrates logging facilities' -a parameters '[{"name": "payload", "required":false, "description":"The string to be included in the log record"}]' \
-     -a sampleInput '{ "payload": "Cat" }' \
-     -a sampleOutput '{ }' \
-     -a sampleLogOutput '2016-03-22T01:02:26.387624916Z stdout: hello Cat!'
-
-install "$PACKAGE_HOME/samples/greeting/javascript/greeting.js" \
-     samples/greeting \
-     -a description 'Returns a friendly greeting' \
-     -a parameters '[{"name": "name", "required":false}, {"name": "place", "required":false, "description":"The string to be included in the return value"}]' \
-     -a sampleInput '{ "payload": "Cat", "place": "Narrowsburg" }' \
-     -a sampleOutput '{ "payload": "Hello, Cat from Narrowsburg!" }' \
-     -a sampleLogOutput "2016-03-22T01:07:08.384982272Z stdout: params: { place: 'Narrowsburg', payload: 'Cat' }"
-
-install "$PACKAGE_HOME/samples/wordcount/javascript/wordcount.js" \
-     samples/wordCount \
-     -a description 'Count words in a string' -a parameters '[{"name": "payload", "required":true, "description":"A string"}]' \
-     -a sampleInput '{ "payload": "Five fuzzy felines"}' \
-     -a sampleOutput '{ "count": 3 }' \
-     -a sampleLogOutput "2016-03-22T01:10:07.361649586Z stdout: The message 'Five fuzzy felines' has 3 words"
-
-install "$PACKAGE_HOME/samples/curl/javascript/curl.js" \
-     samples/curl \
-     -a description 'Curl a host url' -a parameters '[{"name": "payload", "required":true, "description":"A host url"}]' \
-	 -a sampleInput '{ "payload": "google.com"}' \
-     -a sampleOutput '{ "msg": "content returned from google.com" }'
-
-waitForAll
-
-echo whisk.system entities ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/installWeather.sh b/packages/installWeather.sh
deleted file mode 100755
index 0a7b6d9..0000000
--- a/packages/installWeather.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/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.
-#
-# use the command line interface to install Weather.com package.
-#
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-PACKAGE_HOME=$SCRIPTDIR
-source "$PACKAGE_HOME/util.sh"
-
-echo Installing Weather package.
-
-createPackage weather \
-    -p bluemixServiceName "weatherinsights" \
-    -a description "Services from the Weather Company Data for IBM Cloud" \
-    -a parameters '[{"name":"username", "required":false,"bindTime":true}, {"name":"password", "required":false, "type":"password","bindTime":true}]'
-
-waitForAll
-
-install "$PACKAGE_HOME/weather/forecast.js" \
-    weather/forecast \
-    -a description 'IBM Weather Insights 10-day forecast' \
-    -a parameters '[ {"name":"latitude", "required":true}, {"name":"longitude", "required":true},{"name":"language", "required":false},{"name":"units", "required":false}, {"name":"timePeriod", "required":false}, {"name":"username", "required":true, "bindTime":true},{"name":"password", "required":true,"type":"password", "bindTime":true}, {"name":"host", "required":false} ]' \
-    -a sampleInput '{"latitude":"34.063", "longitude":"-84.217", "username":"XXX","password":"XXX"}' \
-    -a sampleOutput '{"forecasts":[ {"dow":"Monday", "min_temp":30, "max_temp":38, "narrative":"Cloudy"} ]}'
-
-waitForAll
-
-echo Weather package ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/installWebSocket.sh b/packages/installWebSocket.sh
deleted file mode 100755
index fcea956..0000000
--- a/packages/installWebSocket.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/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.
-#
-# use the command line interface to install websocket package.
-#
-SCRIPTDIR="$(cd $(dirname "$0")/ && pwd)"
-PACKAGE_HOME=$SCRIPTDIR
-source "$PACKAGE_HOME/util.sh"
-
-echo Installing WebSocket package.
-
-createPackage websocket \
-    -a description "Utilities for communicating with WebSockets" \
-    -a parameters '[ {"name":"uri", "required":true, "bindTime":true} ]'
-
-waitForAll
-
-install "$PACKAGE_HOME/websocket/sendWebSocketMessageAction.js" \
-    websocket/send \
-    -a description 'Send a message to a WebSocket' \
-    -a parameters '[
-      {
-        "name": "uri",
-        "required": true,
-        "description": "The URI of the websocket server."
-      },
-      {
-        "name": "payload",
-        "required": true,
-        "description": "The data you wish to send to the websocket server."
-      }
-    ]' \
-    -a sampleInput '{"uri":"ws://MyAwesomeService.com/sweet/websocket", "payload":"Hi there, WebSocket!"}' \
-    -a sampleOutput '{"result":{"payload":"Hi there, WebSocket!"},"status":"success","success":true}'
-
-waitForAll
-
-echo WebSocket package ERRORS = $ERRORS
-exit $ERRORS
diff --git a/packages/util.sh b/packages/util.sh
index 8ac58db..5eb0fa1 100755
--- a/packages/util.sh
+++ b/packages/util.sh
@@ -29,29 +29,6 @@ AUTH_KEY=$WHISK_SYSTEM_AUTH
 : ${WHISK_API_HOST:?"WHISK_API_HOST must be set and non-empty"}
 EDGE_HOST=$WHISK_API_HOST
 
-function createPackage() {
-    PACKAGE_NAME=$1
-    REST=("${@:2}")
-    CMD_ARRAY=("$WHISK_CLI_PATH" -i --apihost "$EDGE_HOST" package update --auth "$AUTH_KEY" --shared yes "$PACKAGE_NAME" "${REST[@]}")
-    export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes
-    "${CMD_ARRAY[@]}" &
-    PID=$!
-    PIDS+=($PID)
-    echo "Creating package $PACKAGE_NAME with pid $PID"
-}
-
-function install() {
-    RELATIVE_PATH=$1
-    ACTION_NAME=$2
-    REST=("${@:3}")
-    CMD_ARRAY=("$WHISK_CLI_PATH" -i --apihost "$EDGE_HOST" action update --auth "$AUTH_KEY" "$ACTION_NAME" "$RELATIVE_PATH" "${REST[@]}")
-    export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes
-    "${CMD_ARRAY[@]}" &
-    PID=$!
-    PIDS+=($PID)
-    echo "Installing $ACTION_NAME with pid $PID"
-}
-
 function deployProject() {
     RELATIVE_PATH=$1
     REST=("${@:2}")
@@ -63,35 +40,6 @@ function deployProject() {
     echo "Deploying $RELATIVE_PATH with pid $PID"
 }
 
-function runPackageInstallScript() {
-    "$1/$2" &
-    PID=$!
-    PIDS+=($PID)
-    echo "Installing package $2 with pid $PID"
-}
-
-function removePackage() {
-    PACKAGE_NAME=$1
-    REST=("${@:2}")
-    CMD_ARRAY=("$WHISK_CLI_PATH" -i --apihost "$WHISK_API_HOST" package delete --auth "$WHISK_SYSTEM_AUTH" "$PACKAGE_NAME")
-    export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes
-    "${CMD_ARRAY[@]}" &
-    PID=$!
-    PIDS+=($PID)
-    echo "Deleting package $PACKAGE_NAME"
-}
-
-function removeAction() {
-    ACTION_NAME=$1
-    REST=("${@:2}")
-    CMD_ARRAY=("$WHISK_CLI_PATH" -i --apihost "$WHISK_API_HOST" action delete --auth "$WHISK_SYSTEM_AUTH" "$ACTION_NAME")
-    export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes
-    "${CMD_ARRAY[@]}" &
-    PID=$!
-    PIDS+=($PID)
-    echo "Deleting action $ACTION_NAME"
-}
-
 # PIDS is the list of ongoing processes and ERRORS the total number of processes that failed
 PIDS=()
 ERRORS=0