Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions packages/actions/lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ function main(params) {

const manifestFilePath = `${repoDir}/${manifestPath}/${manifestFileName}`;
if (!fs.existsSync(manifestFilePath)) {
if (usingTemp) {
deleteFolder(repoDir);
const altManifestFilePath = `${repoDir}/${manifestPath}/manifest.yml`;
if (!fs.existsSync(altManifestFilePath)) {
if (usingTemp) {
deleteFolder(repoDir);
}
reject(new Error('Error loading manifest file. Does a manifest file exist?'));
}
reject(new Error('Error loading manifest file. Does a manifest file exist?'));
} else {
exec(command, execOptions, (err, stdout, stderr) => {
if (usingTemp) {
Expand Down
15 changes: 15 additions & 0 deletions tests/src/test/scala/packages/deployWebTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ class DeployWebTests extends TestHelpers
val incorrectGithubRepo = "https://github.com/apache/openwhisk-package-deploy-incorrect"
val helloWorldPath = "tests/src/test/scala/testFixtures/helloWorld"
val helloWorldWithNoManifest = "tests/src/test/scala/testFixtures/helloWorldNoManifest"
val helloWorldAltManifest = "tests/src/test/scala/testFixtures/helloWorldAltManifest"
val helloWorldPackageParam = "tests/src/test/scala/testFixtures/helloWorldPackageParam"
val incorrectManifestPath = "does/not/exist"
val helloWorldAction = "openwhisk-helloworld/helloworld"
val helloWorldAltAction = "openwhisk-helloworld/helloworldAlt"
val helloWorldActionPackage = "myPackage/helloworld"

// statuses from deployWeb
Expand Down Expand Up @@ -87,6 +89,19 @@ class DeployWebTests extends TestHelpers
wsk.action.delete(helloWorldAction)
}

// test to create the hello world template with alternate manifest from github
it should "create the hello world action with alternate manifest extension from github url" in {
makePostCallWithExpectedResult(JsObject(
"gitUrl" -> JsString(deployTestRepo),
"manifestPath" -> JsString(helloWorldAltManifest),
"wskApiHost" -> JsString(wskprops.apihost),
"wskAuth" -> JsString(wskprops.authKey)
), successStatus, 200);

// clean up after test
wsk.action.delete(helloWorldAltAction)
}

// 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(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
*
* main() will be invoked when you Run This Action.
*
* @param Cloud Functions actions accept a single parameter,
* which must be a JSON object.
*
* In this case, the params variable will look like:
* { "message": "xxxx" }
*
* @return which must be a JSON object.
* It will be the output of this action.
*
*/
function main(params) {
return { "message": "you sent me " + params.message };
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Wskdeploy manifest for hello-world

# Deployment using this manifest file creates the following OpenWhisk components:
# Package: openwhisk-helloworld
# Action: openwhisk-helloworld/helloworld.js

project:
namespace: _
packages:
openwhisk-helloworld:
version: 1.0
license: Apache-2.0
actions:
helloworldAlt:
function: actions/helloworld.js
1 change: 1 addition & 0 deletions tools/travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $ANSIBLE_CMD initdb.yml
cd $WHISKDIR

TERM=dumb ./gradlew \
:tools:admin:install \
:common:scala:install \
:core:controller:install \
:core:invoker:install \
Expand Down