Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5F975200D4E for ; Thu, 16 Nov 2017 18:09:58 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5E4051609EF; Thu, 16 Nov 2017 17:09:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 83E5B160BEA for ; Thu, 16 Nov 2017 18:09:57 +0100 (CET) Received: (qmail 92229 invoked by uid 500); 16 Nov 2017 17:09:56 -0000 Mailing-List: contact commits-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list commits@openwhisk.apache.org Received: (qmail 92201 invoked by uid 99); 16 Nov 2017 17:09:56 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2017 17:09:56 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 1012781C26; Thu, 16 Nov 2017 17:09:56 +0000 (UTC) Date: Thu, 16 Nov 2017 17:09:56 +0000 To: "commits@openwhisk.apache.org" Subject: [incubator-openwhisk-package-deploy] branch master updated: stream install catalog with push package (#3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151085219601.22461.10697749615049628971@gitbox.apache.org> From: csantanapr@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: incubator-openwhisk-package-deploy X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8cc69e4fda641989cb3c8b8871c99cde95aec410 X-Git-Newrev: 2b0984f106026e84a35a9eda950a2c9732d08a9a X-Git-Rev: 2b0984f106026e84a35a9eda950a2c9732d08a9a X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Thu, 16 Nov 2017 17:09:58 -0000 This is an automated email from the ASF dual-hosted git repository. csantanapr pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-package-deploy.git The following commit(s) were added to refs/heads/master by this push: new 2b0984f stream install catalog with push package (#3) 2b0984f is described below commit 2b0984f106026e84a35a9eda950a2c9732d08a9a Author: David Cariello AuthorDate: Thu Nov 16 11:09:54 2017 -0600 stream install catalog with push package (#3) * stream install catalog with push package * use latest wskdeploy version --- packages/installCatalog.sh | 49 +++++++++++++------------ packages/uninstall.sh | 8 ++-- tests/src/test/scala/packages/DeployTests.scala | 24 ++++++------ 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/packages/installCatalog.sh b/packages/installCatalog.sh index 6516869..ebf4eba 100755 --- a/packages/installCatalog.sh +++ b/packages/installCatalog.sh @@ -4,22 +4,28 @@ # automatically # # To run this command -# ./installCatalog.sh +# ./installCatalog.sh +# AUTH and EDGE_HOST are found in $HOME/.wskprops +# WSK_CLI="$OPENWHISK_HOME/bin/wsk" set -e set -x -: ${OPENWHISK_HOME:?"OPENWHISK_HOME must be set and non-empty"} -WSK_CLI="$OPENWHISK_HOME/bin/wsk" - if [ $# -eq 0 ] then -echo "Usage: ./installCatalog.sh " +echo "Usage: ./installCatalog.sh " fi AUTH="$1" -EDGEHOST="$2" -APIHOST="$3" +EDGE_HOST="$2" +WSK_CLI="$3" +DOCKER="$4" + +# If docker is not provided, set to default version. +if [ -z "$4" ] + then + DOCKER="openwhisk/wskdeploy:0.8.10" +fi # If the auth key file exists, read the key in the file. Otherwise, take the # first argument as the key itself. @@ -27,26 +33,21 @@ if [ -f "$AUTH" ]; then AUTH=`cat $AUTH` fi -# Make sure that the EDGEHOST is not empty. -: ${EDGEHOST:?"EDGEHOST must be set and non-empty"} - -# Make sure that the APIHOST is not empty. -: ${APIHOST:?"APIHOST must be set and non-empty"} - PACKAGE_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes -echo Installing Deploy package. +# wskdeploy actions + +echo Installing wskdeploy package. -$WSK_CLI -i --apihost "$EDGEHOST" package update --auth "$AUTH" --shared yes deploy \ - -a description 'Alarms and periodic utility' \ - -a parameters '[ {"message":"theMessage", "required":true} ]' \ - -p apihost "$APIHOST" \ - -p trigger_payload '' +$WSK_CLI -i --apihost "$EDGE_HOST" package update --auth "$AUTH" --shared yes "deploy" \ +-a description "This package offers a convenient way for you to describe and deploy any part of the OpenWhisk programming model using a Manifest file written in YAML." \ +-a prettyName "Whisk Deploy" -$WSK_CLI -i --apihost "$EDGEHOST" action update --auth "$AUTH" deploy/wskdeploy "$PACKAGE_HOME/actions/deploy.js" \ - -a description 'Creates an action that allows you to run wskdeploy from OpenWhisk' \ - -a parameters '[ {"name":"gitUrl", "required":true, "bindTime":true, "description": "The URL to the GitHub repository to deploy"}, {"name":"manifestPath", "required":false, "bindTime":true, "description": "The relative path to the manifest file from the GitHub repo root"},{"name":"wskApiHost", "required":false, "description": "The URL of the OpenWhisk api host you want to use"}, {"name":"envData", "required":false, "description": "Blueprint-specific environment data object"} ]' \ - -a sampleInput '{"gitUrl":"github.com/my_blueprint", "manifestPath":"runtimes/swift", "wskApiHost":"openwhisk.stage1.ng.bluemix.net", "envData": "{\"KAFKA_ADMIN_URL\":\"https://my_kafka_service\", \"MESSAGEHUB_USER\":\"MY_MESSAGEHUB_USERNAME\"}"}' \ - --docker "openwhisk/wskdeploy:0.8.9.2" +$WSK_CLI -i --apihost "$EDGE_HOST" action update --auth "$AUTH" "deploy/wskdeploy" "$PACKAGE_HOME/actions/deploy.js" \ +-a description 'Creates an action that allows you to run wskdeploy from OpenWhisk' \ +-a parameters '[ {"name":"gitUrl", "required":true, "bindTime":true, "description": "The URL to the GitHub repository to deploy"}, {"name":"manifestPath", "required":false, "bindTime":true, "description": "The relative path to the manifest file from the GitHub repo root"}, {"name":"envData", "required":false, "description": "Blueprint-specific environment data object"} ]' \ +-a sampleInput '{"gitUrl":"github.com/my_blueprint", "manifestPath":"runtimes/swift", "envData": "{\"ENV_VARIABLE_1\":\"VALUE_1\", \"ENV_VARIABLE_2\":\"VALUE_2\"}"}' \ +--docker "$DOCKER" + \ No newline at end of file diff --git a/packages/uninstall.sh b/packages/uninstall.sh index 6e9c7ef..3d9006b 100755 --- a/packages/uninstall.sh +++ b/packages/uninstall.sh @@ -7,14 +7,14 @@ WSK_CLI="$OPENWHISK_HOME/bin/wsk" if [ $# -eq 0 ] then - echo "Usage: ./uninstall.sh $APIHOST $AUTH" + echo "Usage: ./uninstall.sh $EDGE_HOST $AUTH" fi -APIHOST="$1" +EDGE_HOST="$1" AUTH="$2" echo Uninstalling Template Package \ -$WSK_CLI --apihost $APIHOST action delete -i --auth $AUTH deploy/wskdeploy +$WSK_CLI --apihost $EDGE_HOST action delete -i --auth $AUTH deploy/wskdeploy -$WSK_CLI --apihost $APIHOST package delete -i --auth $AUTH deploy +$WSK_CLI --apihost $EDGE_HOST package delete -i --auth $AUTH deploy diff --git a/tests/src/test/scala/packages/DeployTests.scala b/tests/src/test/scala/packages/DeployTests.scala index 6b4288e..e4da762 100644 --- a/tests/src/test/scala/packages/DeployTests.scala +++ b/tests/src/test/scala/packages/DeployTests.scala @@ -21,9 +21,9 @@ package packages import org.junit.runner.RunWith import org.scalatest.BeforeAndAfterAll import org.scalatest.junit.JUnitRunner -import common._ -import spray.json.DefaultJsonProtocol._ -import spray.json._ +import common.{TestHelpers, Wsk, WskProps, WskTestHelpers, _} +import spray.json.DefaultJsonProtocol.StringJsonFormat +import spray.json.pimpAny @RunWith(classOf[JUnitRunner]) class DeployTests extends TestHelpers @@ -47,8 +47,10 @@ class DeployTests extends TestHelpers val helloWorldAction = "openwhisk-helloworld/helloworld" val helloWorldActionPackage = "myPackage/helloworld" + behavior of "Deploy Package" + //test to create the hello world blueprint from github - "Deploy Package" should "create the hello world action from github url" in { + it should "create the hello world action from github url" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> deployTestRepo.toJson, "manifestPath" -> helloWorldPath.toJson)) @@ -63,7 +65,7 @@ class DeployTests extends TestHelpers } //test to create the hello world blueprint from github with myPackage as package name - "Deploy Package" should s"create the $helloWorldActionPackage action from github url" in { + it should s"create the $helloWorldActionPackage action from github url" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> deployTestRepo.toJson, "manifestPath" -> helloWorldPackageParam.toJson, @@ -79,7 +81,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with no github repo provided - "Deploy Package" should "return error if there is no github repo provided" in { + it should "return error if there is no github repo provided" in { val run = wsk.action.invoke(deployAction, Map( "manifestPath" -> helloWorldPath.toJson)) withActivation(wsk.activation, run) { @@ -90,7 +92,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with a nonexistant github repo provided - "Deploy Package" should "return error if there is an nonexistant repo provided" in { + it should "return error if there is an nonexistant repo provided" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> incorrectGithubRepo.toJson, "manifestPath" -> helloWorldPath.toJson)) @@ -102,7 +104,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with a malformed github repo - "Deploy Package" should "return error if there is a malformed gitUrl provided" in { + it should "return error if there is a malformed gitUrl provided" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> malformedRepoUrl.toJson, "manifestPath" -> helloWorldPath.toJson)) @@ -114,7 +116,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with useless EnvData provided - "Deploy Package" should "return succeed if useless envData is provided" in { + it should "return succeed if useless envData is provided" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> deployTestRepo.toJson, "manifestPath" -> helloWorldPath.toJson, @@ -130,7 +132,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with an incorrect manifestPath provided - "Deploy Package" should "return with failure if incorrect manifestPath is provided" in { + it should "return with failure if incorrect manifestPath is provided" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> deployTestRepo.toJson, "manifestPath" -> incorrectManifestPath.toJson)) @@ -142,7 +144,7 @@ class DeployTests extends TestHelpers } //test to create a blueprint with manifestPath provided, but no manifestFile existing - "Deploy Package" should "return with failure if no manifest exists at manifestPath" in { + it should "return with failure if no manifest exists at manifestPath" in { val run = wsk.action.invoke(deployAction, Map( "gitUrl" -> deployTestRepo.toJson, "manifestPath" -> helloWorldWithNoManifest.toJson)) -- To stop receiving notification emails like this one, please contact ['"commits@openwhisk.apache.org" '].