You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/14 21:01:50 UTC

[GitHub] dubeejw closed pull request #10: Rename to templates

dubeejw closed pull request #10: Rename to templates
URL: https://github.com/apache/incubator-openwhisk-package-deploy/pull/10
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.gitignore b/.gitignore
index cc92890..31ae07b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,6 @@
 build/
 tests/credentials.json
 openwhisk
-packages/actions/blueprints
+packages/actions/templates
 packages/actions/package.json
 packages/actions/deployWeb.zip
diff --git a/README.md b/README.md
index 6c0de6f..ed48f27 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@ The package includes the following actions.
 
 ## wskdeploy Parameters
 The `/whisk.system/deploy/wskdeploy` package deploys OpenWhisk assets from a github repository with a defining manifest.  The parameters are as follows:
-- `gitUrl`: A string specifying the location of the github repository containing the assets to be deployed. For example: `https://github.com/ibm-functions/blueprint-cloudant-trigger`
+- `gitUrl`: A string specifying the location of the github repository containing the assets to be deployed. For example: `https://github.com/ibm-functions/template-cloudant-trigger`
 
 - `manifestPath`: Optional. A string specifying the location of the folder enclosing the manifest.yaml file. For example: `src/openwhisk`. If this parameter is not provided, it will default to the root of the github repo.
 
@@ -28,9 +28,9 @@ The `/whisk.system/deploy/wskdeploy` package deploys OpenWhisk assets from a git
 
 ## Setting up your Repository
 
-A simple hello world example of a deployable github repository can be found [here](https://github.com/ibm-functions/blueprint-hello-world/).
+A simple hello world example of a deployable github repository can be found [here](https://github.com/ibm-functions/template-hello-world/).
 
-A more complex example of a deployable github repository, including a trigger, a sequence, and cloudant credentials  can be found [here](https://github.com/ibm-functions/blueprint-cloudant-trigger).
+A more complex example of a deployable github repository, including a trigger, a sequence, and cloudant credentials  can be found [here](https://github.com/ibm-functions/template-cloudant-trigger).
 
 1. Create a github repository with a manifest.yaml at its root, and an actions directory containing any source files.
 * actions
@@ -55,7 +55,7 @@ With the repository created, you can now deploy from it.
 
   ```
   wsk action invoke /whisk.system/deploy/wskdeploy
-  -p gitUrl https://github.com/ibm-functions/blueprint-hello-world/
+  -p gitUrl https://github.com/ibm-functions/template-hello-world/
   -p manifestPath "src/openwhisk"
   ```
 
@@ -66,7 +66,7 @@ With the repository created, you can now deploy from it.
 1. `git clone https://github.com/openwhisk/incubator-openwhisk-package-deploy`
 2. `cd incubator-openwhisk-package-deploy/packages`
 3. `./installCatalog.sh AUTH EDGE_HOST WSK_CLI DOCKER`
-   AUTH is your auth key.  EDGE_HOST is the OpenWhisk hostname.  WSK_CLI is location of the Openwhisk CLI binary. DOCKER is an optional param for the desired `wskdeploy` docker image, resolves to `openwhisk/wskdeploy:0.8.10` by default.
+   AUTH is your auth key.  EDGE_HOST is the OpenWhisk hostname.  WSK_CLI is location of the Openwhisk CLI binary. DOCKER is an optional param for the desired `wskdeploy` docker image, resolves to `openwhisk/wskdeploy:0.8.12` by default.
 
 > You can also remove the package using `uninstall.sh` in a similar fashion like so:
 > `./uninstall.sh AUTH EDGE_HOST WSK_CLI`
diff --git a/packages/actions/deployWeb.js b/packages/actions/deployWeb.js
index ccbf160..1470f65 100644
--- a/packages/actions/deployWeb.js
+++ b/packages/actions/deployWeb.js
@@ -40,10 +40,10 @@ function main(params) {
       const repoSplit = params.gitUrl.split('/');
       const repoName = repoSplit[repoSplit.length - 1];
       const localDirName = `${__dirname}/../tmp/${repoName}`;
-      const blueprintsDirName = `${__dirname}/blueprints/${repoName}`;
-      if (repoSplit[2] === 'github.com' && repoSplit[3] === 'ibm-functions' && fs.existsSync(blueprintsDirName)) {
+      const templatesDirName = `${__dirname}/templates/${repoName}`;
+      if (repoSplit[2] === 'github.com' && repoSplit[3] === 'ibm-functions' && fs.existsSync(templatesDirName)) {
         resolve({
-          repoDir: blueprintsDirName,
+          repoDir: templatesDirName,
           manifestPath,
           manifestFileName: 'manifest.yaml',
           wskAuth,
diff --git a/packages/installCatalog.sh b/packages/installCatalog.sh
index 0a79955..63713d6 100755
--- a/packages/installCatalog.sh
+++ b/packages/installCatalog.sh
@@ -25,7 +25,7 @@ INSTALL_WEB_ONLY="${INSTALL_WEB_ONLY:-True}"
 # If docker is not provided, set to default version.
 if [ -z "$4" ]
   then
-    DOCKER="openwhisk/wskdeploy:0.8.10"
+    DOCKER="openwhisk/wskdeploy:0.8.12"
 fi
 
 # If the auth key file exists, read the key in the file. Otherwise, take the
@@ -38,14 +38,14 @@ PACKAGE_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
 export WSK_CONFIG_FILE= # override local property file to avoid namespace clashes
 
-# clone all Blueprints
-for bp in blueprint-hello-world blueprint-cloudant-trigger blueprint-messagehub-trigger
+# clone all Templates
+for tmpl in template-hello-world template-cloudant-trigger template-messagehub-trigger
 do
-  if [ -e actions/blueprints/$bp ]
+  if [ -e actions/templates/$tmpl ]
     then
-    rm -rf actions/blueprints/$bp
+    rm -rf actions/templates/$tmpl
   fi
-  git clone --depth 1 https://github.com/ibm-functions/$bp actions/blueprints/$bp
+  git clone --depth 1 https://github.com/ibm-functions/$tmpl actions/templates/$tmpl
 done
 
 # make deployWeb.zip & install
@@ -58,7 +58,7 @@ if [ -e deployWeb.zip ]
 fi
 
 cp -f deployWeb_package.json package.json
-zip -r deployWeb.zip package.json deployWeb.js lib/common.js blueprints/
+zip -r deployWeb.zip package.json deployWeb.js lib/common.js templates/
 
 cd $OLD_PATH
 
@@ -68,8 +68,8 @@ $WSK_CLI -i --apihost "$EDGE_HOST" package update --auth "$AUTH" --shared no "de
 
 $WSK_CLI -i --apihost "$EDGE_HOST" action update --auth "$AUTH" "deployWeb/wskdeploy" "$PACKAGE_HOME/actions/deployWeb.zip" --web true \
 -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\"}"}' \
+-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": "Template-specific environment data object"} ]' \
+-a sampleInput '{"gitUrl":"github.com/my_template", "manifestPath":"runtimes/swift", "envData": "{\"ENV_VARIABLE_1\":\"VALUE_1\", \"ENV_VARIABLE_2\":\"VALUE_2\"}"}' \
 --docker "$DOCKER"
 
 
@@ -94,7 +94,7 @@ if [ $INSTALL_WEB_ONLY = False ]
 
   $WSK_CLI -i --apihost "$EDGE_HOST" action update --auth "$AUTH" "deploy/wskdeploy" "$PACKAGE_HOME/actions/deploy.zip" \
   -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\"}"}' \
+  -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": "Template-specific environment data object"} ]' \
+  -a sampleInput '{"gitUrl":"github.com/my_template", "manifestPath":"runtimes/swift", "envData": "{\"ENV_VARIABLE_1\":\"VALUE_1\", \"ENV_VARIABLE_2\":\"VALUE_2\"}"}' \
   --docker "$DOCKER"
 fi
diff --git a/tests/src/test/scala/packages/DeployTests.scala b/tests/src/test/scala/packages/DeployTests.scala
index 9dafefa..346f089 100644
--- a/tests/src/test/scala/packages/DeployTests.scala
+++ b/tests/src/test/scala/packages/DeployTests.scala
@@ -33,10 +33,10 @@ class DeployTests extends TestHelpers
     implicit val wskprops = WskProps()
     val wsk = new Wsk()
 
-    //set parameters for deploy tests
+    // set parameters for deploy tests
     val deployTestRepo = "https://github.com/apache/incubator-openwhisk-package-deploy"
     val incorrectGithubRepo = "https://github.com/apache/openwhisk-package-deploy-incorrect"
-    val malformedRepoUrl = "github.com/ibm-functions/blueprint-hello-world"
+    val malformedRepoUrl = "github.com/ibm-functions/template-hello-world"
     val helloWorldPath = "tests/src/test/scala/testFixtures/helloWorld"
     val helloWorldWithNoManifest = "tests/src/stest/scala/testFixtures/helloWorldNoManifest"
     val helloWorldPackageParam = "tests/src/test/scala/testFixtures/helloWorldPackageParam"
@@ -49,7 +49,7 @@ class DeployTests extends TestHelpers
 
     behavior of "Deploy Package"
 
-    //test to create the hello world blueprint from github
+    // test to create the hello world template from github
     it should "create the hello world action from github url" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> deployTestRepo.toJson,
@@ -64,7 +64,7 @@ class DeployTests extends TestHelpers
         wsk.action.delete(helloWorldAction)
     }
 
-    //test to create the hello world blueprint from github with myPackage as package name
+    // test to create the hello world template from github with myPackage as package name
     it should s"create the $helloWorldActionPackage action from github url" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> deployTestRepo.toJson,
@@ -80,7 +80,7 @@ class DeployTests extends TestHelpers
         wsk.action.delete(helloWorldActionPackage)
     }
 
-    //test to create a blueprint with no github repo provided
+    // test to create a template with no github repo provided
     it should "return error if there is no github repo provided" in {
       val run = wsk.action.invoke(deployAction, Map(
         "manifestPath" -> helloWorldPath.toJson))
@@ -91,7 +91,7 @@ class DeployTests extends TestHelpers
         }
     }
 
-    //test to create a blueprint with a nonexistant github repo provided
+    // test to create a template with a nonexistant github repo provided
     it should "return error if there is an nonexistant repo provided" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> incorrectGithubRepo.toJson,
@@ -103,7 +103,7 @@ class DeployTests extends TestHelpers
         }
     }
 
-    //test to create a blueprint with a malformed github repo
+    // test to create a template with a malformed github repo
     it should "return error if there is a malformed gitUrl provided" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> malformedRepoUrl.toJson,
@@ -115,7 +115,7 @@ class DeployTests extends TestHelpers
         }
     }
 
-    //test to create a blueprint with useless EnvData provided
+    // test to create a template with useless EnvData provided
     it should "return succeed if useless envData is provided" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> deployTestRepo.toJson,
@@ -131,7 +131,7 @@ class DeployTests extends TestHelpers
         wsk.action.delete(helloWorldAction)
     }
 
-    //test to create a blueprint with an incorrect manifestPath provided
+    // test to create a template with an incorrect manifestPath provided
     it should "return with failure if incorrect manifestPath is provided" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> deployTestRepo.toJson,
@@ -143,7 +143,7 @@ class DeployTests extends TestHelpers
         }
     }
 
-    //test to create a blueprint with manifestPath provided, but no manifestFile existing
+    // test to create a template with manifestPath provided, but no manifestFile existing
     it should "return with failure if no manifest exists at manifestPath" in {
       val run = wsk.action.invoke(deployAction, Map(
         "gitUrl" -> deployTestRepo.toJson,
diff --git a/tests/src/test/scala/packages/deployWebTests.scala b/tests/src/test/scala/packages/deployWebTests.scala
index ee0ba92..df574d5 100644
--- a/tests/src/test/scala/packages/deployWebTests.scala
+++ b/tests/src/test/scala/packages/deployWebTests.scala
@@ -37,14 +37,14 @@ class DeployWebTests extends TestHelpers
     implicit val wskprops = WskProps()
     val wsk = new Wsk()
 
-    //action and web action url
+    // action and web action url
     val deployAction = "/whisk.system/deployWeb/wskdeploy"
     val deployActionURL = s"https://${wskprops.apihost}/api/v1/web${deployAction}.http"
 
-    //set parameters for deploy tests
+    // set parameters for deploy tests
     val deployTestRepo = "https://github.com/apache/incubator-openwhisk-package-deploy"
     val incorrectGithubRepo = "https://github.com/apache/openwhisk-package-deploy-incorrect"
-    val malformedRepoUrl = "github.com/ibm-functions/blueprint-hello-world"
+    val malformedRepoUrl = "github.com/ibm-functions/template-hello-world"
     val helloWorldPath = "tests/src/test/scala/testFixtures/helloWorld"
     val helloWorldWithNoManifest = "tests/src/test/scala/testFixtures/helloWorldNoManifest"
     val helloWorldPackageParam = "tests/src/test/scala/testFixtures/helloWorldPackageParam"
@@ -73,7 +73,7 @@ class DeployWebTests extends TestHelpers
       wsk.action.get(deployAction, FORBIDDEN)
     }
 
-    //test to create the hello world blueprint from github
+    // test to create the hello world template from github
     it should "create the hello world action from github url" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(deployTestRepo),
@@ -86,7 +86,7 @@ class DeployWebTests extends TestHelpers
       wsk.action.delete(helloWorldAction)
     }
 
-    // test to create the hello world blueprint from github with myPackage as package name
+    // test to create the hello world template from github with myPackage as package name
     it should s"create the $helloWorldActionPackage action from github url" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(deployTestRepo),
@@ -100,7 +100,7 @@ class DeployWebTests extends TestHelpers
       wsk.action.delete(helloWorldActionPackage)
     }
 
-    // test to create a blueprint with no github repo provided
+    // test to create a template with no github repo provided
     it should "return error if there is no github repo provided" in {
       makePostCallWithExpectedResult(JsObject(
         "manifestPath" -> JsString(helloWorldPath),
@@ -109,7 +109,7 @@ class DeployWebTests extends TestHelpers
       ), """{"error":"Please enter the GitHub repo url in params"}""", 400)
     }
 
-    //test to create a blueprint with a nonexistant github repo provided
+    // test to create a template with a nonexistant github repo provided
     it should "return error if there is an nonexistant repo provided" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(incorrectGithubRepo),
@@ -118,7 +118,7 @@ class DeployWebTests extends TestHelpers
         "wskAuth" -> JsString(wskprops.authKey)
       ), githubNonExistentStatus, 400)
     }
-    //test to create a blueprint with a malformed github repo
+    // test to create a template with a malformed github repo
     it should "return error if there is a malformed gitUrl provided" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(malformedRepoUrl),
@@ -128,7 +128,7 @@ class DeployWebTests extends TestHelpers
       ), githubNonExistentStatus, 400)
     }
 
-    // test to create a blueprint with useless EnvData provided
+    // test to create a template with useless EnvData provided
     it should "return succeed if useless envData is provided" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(deployTestRepo),
@@ -142,7 +142,7 @@ class DeployWebTests extends TestHelpers
       wsk.action.delete(helloWorldAction)
     }
 
-    // test to create a blueprint with an incorrect manifestPath provided
+    // test to create a template with an incorrect manifestPath provided
     it should "return with failure if incorrect manifestPath is provided" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(deployTestRepo),
@@ -152,7 +152,7 @@ class DeployWebTests extends TestHelpers
       ), """{"error":"Error loading manifest file. Does a manifest file exist?"}""", 400)
     }
 
-    // test to create a blueprint with manifestPath provided, but no manifestFile existing
+    // test to create a template with manifestPath provided, but no manifestFile existing
     it should "return with failure if no manifest exists at manifestPath" in {
       makePostCallWithExpectedResult(JsObject(
         "gitUrl" -> JsString(deployTestRepo),


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services