csantanapr closed pull request #6: import correction
URL: https://github.com/apache/incubator-openwhisk-package-deploy/pull/6
 
 
   

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/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..e3b3c74
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,9 @@
+{
+  "curly"         : true,
+  "eqeqeq"        : true,
+  "forin"         : false,
+  "esversion"     : 6,
+  "loopfunc"      : true,
+  "module"        : true,
+  "node"          : true
+}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 1c54cc6..536aab7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,8 +19,6 @@ notifications:
 install: true
 
 before_install:
-  - git clone https://github.com/openwhisk/openwhisk.git
-  - cd openwhisk
   - ./tools/travis/setup.sh
 
 script:
diff --git a/packages/actions/deploy.js b/packages/actions/deploy.js
index 8794c04..e5e7fa5 100644
--- a/packages/actions/deploy.js
+++ b/packages/actions/deploy.js
@@ -81,7 +81,7 @@ function main(params) {
     command = `printf 'y' | ${__dirname}/wskdeploy -v -m ${manifestFileName} 
--auth ${wskAuth} --apihost ${wskApiHost}`;
 
     return new Promise((resolve, reject) => {
-      const manifestFilePath = `${repoDir}/${manifestPath}/${manifestFileName}`
+      const manifestFilePath = 
`${repoDir}/${manifestPath}/${manifestFileName}`;
       if (!fs.existsSync(manifestFilePath)) {
         reject(`Error loading ${manifestFilePath}. Does a manifest file 
exist?`);
       } else {
@@ -119,7 +119,7 @@ function main(params) {
           });
         });
       }
-    })
+    });
   });
 }
 
@@ -165,6 +165,6 @@ function deleteFolder(pathToDelete) {
     });
     fs.rmdirSync(pathToDelete);
   }
-};
+}
 
 exports.main = main;
diff --git a/tests/src/test/scala/packages/DeployTests.scala 
b/tests/src/test/scala/packages/DeployTests.scala
index e4da762..9dafefa 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.{TestHelpers, Wsk, WskProps, WskTestHelpers, _}
+import common.{TestHelpers, Wsk, WskProps, WskTestHelpers}
 import spray.json.DefaultJsonProtocol.StringJsonFormat
-import spray.json.pimpAny
+import spray.json._
 
 @RunWith(classOf[JUnitRunner])
 class DeployTests extends TestHelpers
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 866669d..42f3c37 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -1,17 +1,22 @@
 #!/bin/bash
+set -e
+
 # Build script for Travis-CI.
 
 SCRIPTDIR=$(cd $(dirname "$0") && pwd)
 ROOTDIR="$SCRIPTDIR/../.."
-WHISKDIR="$ROOTDIR/openwhisk"
-
-cd $WHISKDIR
+WHISKDIR="$ROOTDIR/../openwhisk"
+UTILDIR="$ROOTDIR/../incubator-openwhisk-utilities"
 
-tools/build/scanCode.py $ROOTDIR
+# run scancode
+cd $UTILDIR
+scancode/scanCode.py $ROOTDIR
 
-# No point to continue with PRs, since encryption is on
-if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
+# run jshint
+cd $ROOTDIR/packages
+jshint .
 
+# Install OpenWhisk
 cd $WHISKDIR/ansible
 
 ANSIBLE_CMD="ansible-playbook -i environments/local"
@@ -23,16 +28,19 @@ $ANSIBLE_CMD initdb.yml
 
 cd $WHISKDIR
 
-./gradlew distDocker
+TERM=dumb ./gradlew distDocker
 
 cd $WHISKDIR/ansible
 
 $ANSIBLE_CMD wipe.yml
 $ANSIBLE_CMD openwhisk.yml
 
+# Set Environment
+export OPENWHISK_HOME=$WHISKDIR
+
 cd $WHISKDIR
 
-VCAP_SERVICES_FILE="$(readlink -f $WHISKDIR/../tests/credentials.json)"
+VCAP_SERVICES_FILE="$(readlink -f $ROOTDIR/tests/credentials.json)"
 
 #update whisk.properties to add tests/credentials.json file to 
vcap.services.file, which is needed in tests
 WHISKPROPS_FILE="$WHISKDIR/whisk.properties"
@@ -43,12 +51,11 @@ WSK_CLI=$WHISKDIR/bin/wsk
 AUTH_KEY=$(cat $WHISKDIR/ansible/files/auth.whisk.system)
 EDGE_HOST=$(grep '^edge.host=' $WHISKPROPS_FILE | cut -d'=' -f2)
 
-# Set Environment
-export OPENWHISK_HOME=$WHISKDIR
+# Install Package
 
-# Install the package
-source $ROOTDIR/packages/installCatalog.sh $AUTH_KEY $EDGE_HOST $WSK_CLI
+cd $ROOTDIR/packages
+./installCatalog.sh $AUTH_KEY $EDGE_HOST $WSK_CLI
 
 # Test
 cd $ROOTDIR
-./gradlew :tests:test
+TERM=dumb ./gradlew :tests:test
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
new file mode 100755
index 0000000..09adb10
--- /dev/null
+++ b/tools/travis/setup.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+HOMEDIR="$SCRIPTDIR/../../../"
+
+# jshint support
+sudo apt-get -y install nodejs npm
+sudo npm install -g jshint
+
+# clone utilties repo. in order to run scanCode.py
+cd $HOMEDIR
+git clone https://github.com/apache/incubator-openwhisk-utilities.git
+
+# shallow clone OpenWhisk repo.
+git clone --depth 1 https://github.com/apache/incubator-openwhisk.git openwhisk
+
+cd openwhisk
+./tools/travis/setup.sh
\ No newline at end of file


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to