From 497a97754f34caecdcbf9f29f2f2484d63aef377 Mon Sep 17 00:00:00 2001
From: Carlos Santana <csantana@us.ibm.com>
Date: Sun, 8 Oct 2017 15:08:48 -0400
Subject: [PATCH] configure as stand-alone repo

---
 .travis.yml                                   | 22 ++++++
 README.md                                     | 73 +++++++++++++++++++
 ansible/environments/local/group_vars/all     | 52 +++++++++++++
 ansible/environments/local/hosts              | 26 +++++++
 core/python2Action/CHANGELOG.md               | 49 +++++++++++++
 .../actionproxy.py                            |  0
 core/python2Action/build.gradle               |  1 -
 core/{actionProxy => python2Action}/invoke.py |  0
 core/pythonAction/CHANGELOG.md                | 50 +++++++++++++
 core/pythonAction/Dockerfile                  |  2 +-
 core/pythonAction/build.gradle                |  1 -
 settings.gradle                               | 29 +++-----
 tests/build.gradle                            | 59 +--------------
 .../actionContainers/ActionContainer.scala    |  2 +-
 .../ActionProxyContainerTests.scala           |  2 +-
 .../Python2ActionContainerTests.scala         |  2 +-
 .../PythonActionContainerTests.scala          |  2 +-
 .../actionContainers/ResourceHelpers.scala    |  2 +-
 tools/travis/build.sh                         | 38 ++++++++++
 tools/travis/deploy.sh                        | 39 ++++++++++
 tools/travis/publish.sh                       | 32 ++++++++
 tools/travis/setup.sh                         | 15 ++++
 tools/travis/test.sh                          | 17 +++++
 23 files changed, 433 insertions(+), 82 deletions(-)
 create mode 100644 .travis.yml
 create mode 100644 README.md
 create mode 100755 ansible/environments/local/group_vars/all
 create mode 100644 ansible/environments/local/hosts
 create mode 100644 core/python2Action/CHANGELOG.md
 rename core/{actionProxy => python2Action}/actionproxy.py (100%)
 rename core/{actionProxy => python2Action}/invoke.py (100%)
 create mode 100644 core/pythonAction/CHANGELOG.md
 create mode 100755 tools/travis/build.sh
 create mode 100755 tools/travis/deploy.sh
 create mode 100755 tools/travis/publish.sh
 create mode 100755 tools/travis/setup.sh
 create mode 100755 tools/travis/test.sh

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..eaee7751
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,22 @@
+sudo: required
+group: deprecated-2017Q3
+language: scala
+scala:
+- 2.11.8
+services:
+- docker
+before_install:
+- "./tools/travis/setup.sh"
+install: true
+script:
+- "./tools/travis/build.sh && ./tools/travis/deploy.sh && ./tools/travis/test.sh"
+deploy:
+- provider: script
+  script: "./tools/travis/publish.sh csantanapr ${TRAVIS_TAG%@*} ${TRAVIS_TAG##*@}"
+  on:
+    tags: true
+    all_branches: true
+env:
+  global:
+  - secure: ekeKM0bPtGx051FdMOUmqK8yDGQGlyGkJeMU+PAzwWf2XBGzl3SQijOse6uRpyMT/ik3V4rO3CsW+Bdlsu50ylF8nKGVtTpuISTetUCtDHg6m8Fwro//JeXHi3ufJaHtNNos5m8ZmX8rkGZLLSsIwrNQzYHHfiqDhdAL642snLfk3qddjjRBdYD7jGQBr6EwVu5sEORmDJf63I4wwW8fI7olBtIa4W1xW/2dZGoxNU984ypOzG0yoerxgxsuD1ZchS9R93NEG8kcQLpmzqYMFN9XguqXWdp4f8ImbSIGQ0ANDtHIGs+7ZX56fuDA0VsDwK9OCIfG1ZrsO94/fdb/sbSKKuYc0u4l5SVx+n6gdttikGJT6IMM2kRQ5eT/SbJiZshyLkB117IVq3JHTIS3alDSIchFP589sVxfAVzZJ89p5cq7g2JU+weObgxd6Tp/rkEjF5Obo2/5iFf+J5Lf56Ei83SnmYeu7maAzIv+fLzTONymWpCwOtQcif4LeiMNTUdgYtHRBKRCFaMEuOaGi20YuIyoy+OULM/KUFDHwIJROkNFZ+SQ19Jx0qQOIY85E8+D4JBLcXp8VZVGMY+ZnoE76ih/WZZ8wl3zwq0+l53sYhOWUfo5fFSxqg5Ac6gG9OTeO4PmmV/m7ZKdFWFbGbB4qhBq+4swsVpOR+cMuUQ=
+  - secure: dMiAsOrklxVR/tkyM11pibEpqdz1qEjziDU1slIYCG4PFRmX9DC9s+fe5gnOCLhyXmt0khz+MG5Pg9bjOma06XbaUAxPvQ+pAf1/OO/e96VLLEo7Bz4jY8qJlvQTfDbAJFlmXOThNu81uNWAvccb+7+Bf/26UOH5vmAvpdIGTsudU1kmC4C+WYRNjtY0us1OPP6jabKZ7jCnQ8m5rAaUPAwuyiwKPEM+Uk0Yo0SvyiMyxihJIJnPi3kT7D0wqQdq9l9WGWSJRCnu6sRpc/VFDRfIcAnxVrg/AuGRxXedO8QdJvJTugxmIxbwB3bYGHZBfHIQkiQfo+7urWXpApNr5ytUjMm0u6ktb53zjhGm2T16Ow04DByT8FWyMnak+ekyV2v7E037Gdq28SgclbZTTJYMtix0rylt/d70upsDbiOKulxWhhIIv1+qZa9kaclW/FXe+0VziSSspJv6ZzXe1DBEpi/W3dm6/GUzbm41h/5agnvCspJ7itsksaXOwCDB3jSCMcqpW9JiLjDyVklycF9QsGUPOa9hOA3eTve2Y3G3ToPFG7tCZYj/SbN6Cm6jpuFcczjT/Lps8XNg0jDcpfZJYP+vWiPa/4vJdo/NAvOdr+VesxAC/2BIGu4OSBi/ayXeEDa8QEen7BCmfYWAtkTsKhO6JNx81e1KekT802o=
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..1585e8d7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,73 @@
+# Apache OpenWhisk runtimes for swift
+[![Build Status](https://travis-ci.org/apache/incubator-openwhisk-runtime-python.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-runtime-python)
+
+
+### Give it a try today
+To use as a docker action using python 3
+```
+wsk action update myAction myAction.py --docker openwhisk/python3action:1.0.0
+```
+Replace `python3ction` with `python2acton` to use python 2.
+
+
+### To use on deployment that contains the rutime as a kind
+To use as a kind action using python 3
+```
+wsk action update myAction myAction.swift --kind python:3
+```
+Replace `python:3` with `python:2` to use python 2.
+
+
+### Local development
+```
+./gradlew core:pythonAction:distDocker
+```
+This will produce the image `whisk/python3action`
+
+Build and Push image
+```
+docker login
+./gradlew core:pythonAction:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io 
+```
+Replace `core:pythonAction` with `core:python2Action` to build python 2 instead.
+
+Deploy OpenWhisk using ansible environment that contains the kind `python:3` and `python:2`
+Assuming you have OpenWhisk already deploy localy and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
+
+Set `ROOTDIR` to the root directory of this repository.
+
+Redeploy OpenWhisk
+```
+cd $OPENWHISK_HOME/ansible
+ANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local"
+$ANSIBLE_CMD setup.yml
+$ANSIBLE_CMD couchdb.yml
+$ANSIBLE_CMD initdb.yml
+$ANSIBLE_CMD wipe.yml
+$ANSIBLE_CMD openwhisk.yml
+```
+
+Or you can use `wskdev` and create a soft link to the target ansible environment, for example:
+```
+ln -s ${ROOTDIR}/ansible/environments/local ${OPENWHISK_HOME}/ansible/environments/local-python
+wskdev fresh -t local-python
+```
+
+To use as docker action push to your own dockerhub account
+```
+docker tag whisk/python3action $user_prefix/python
+docker push $user_prefix/python3action
+```
+Then create the action using your the image from dockerhub
+```
+wsk action update myAction myAction.py --docker $user_prefix/python3action
+```
+The `$user_prefix` is usually your dockerhub user id.
+Replace `python3action` with `python2action` to use python 2
+
+
+
+# License
+[Apache 2.0](LICENSE.txt)
+
+
diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all
new file mode 100755
index 00000000..2b82ecd6
--- /dev/null
+++ b/ansible/environments/local/group_vars/all
@@ -0,0 +1,52 @@
+whisk_version_name: local
+config_root_dir: /tmp
+whisk_logs_dir: /tmp/wsklogs
+docker_registry: ""
+docker_dns: ""
+
+db_prefix: whisk_local_
+
+# Auto lookup to find the db credentials
+db_provider: "{{ lookup('ini', 'db_provider section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+db_username: "{{ lookup('ini', 'db_username section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+db_password: "{{ lookup('ini', 'db_password section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+db_protocol: "{{ lookup('ini', 'db_protocol section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+db_host: "{{ lookup('ini', 'db_host section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+db_port: "{{ lookup('ini', 'db_port section=db_creds file={{ playbook_dir }}/db_local.ini') }}"
+
+# API GW connection configuration
+apigw_auth_user: ""
+apigw_auth_pwd: ""
+apigw_host_v2: "http://{{ groups['apigateway']|first }}:{{apigateway.port.api}}/v2"
+
+controller_arguments: '-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1098'
+invoker_arguments: "{{ controller_arguments }}"
+
+invoker_allow_multiple_instances: true
+
+runtimes_manifest:
+  defaultImagePrefix: "openwhisk"
+  defaultImageTag: "latest"
+  runtimes:
+    nodejs:
+    - kind: "nodejs:6"
+      default: true
+      image:
+        name: "nodejs6action"
+      deprecated: false
+    python:
+    - kind: "python"
+      image:
+        name: "python2action"
+      deprecated: false
+    - kind: "python:2"
+      default: true
+      image:
+        name: "python2action"
+      deprecated: false
+    - kind: "python:3"
+      image:
+        name: "python3action"
+      deprecated: false
+  blackboxes:
+    - name: "dockerskeleton"
diff --git a/ansible/environments/local/hosts b/ansible/environments/local/hosts
new file mode 100644
index 00000000..c99f195f
--- /dev/null
+++ b/ansible/environments/local/hosts
@@ -0,0 +1,26 @@
+; the first parameter in a host is the inventory_hostname
+
+; used for local actions only
+ansible ansible_connection=local
+
+[edge]
+172.17.0.1          ansible_host=172.17.0.1 ansible_connection=local
+
+[controllers]
+controller0         ansible_host=172.17.0.1 ansible_connection=local
+
+[kafka]
+172.17.0.1          ansible_host=172.17.0.1 ansible_connection=local
+
+[invokers]
+invoker0            ansible_host=172.17.0.1 ansible_connection=local
+
+; db group is only used if db_provider is CouchDB
+[db]
+172.17.0.1          ansible_host=172.17.0.1 ansible_connection=local
+
+[redis]
+172.17.0.1          ansible_host=172.17.0.1 ansible_connection=local
+
+[apigateway]
+172.17.0.1          ansible_host=172.17.0.1 ansible_connection=local
diff --git a/core/python2Action/CHANGELOG.md b/core/python2Action/CHANGELOG.md
new file mode 100644
index 00000000..5905061a
--- /dev/null
+++ b/core/python2Action/CHANGELOG.md
@@ -0,0 +1,49 @@
+# Python 2 OpenWhisk Runtime Container
+
+
+
+## 1.0.0
+Change: Initial release
+
+Python version = 2.7.12
+
+- asn1crypto (0.22.0)
+- attrs (17.2.0)
+- beautifulsoup4 (4.5.1)
+- cffi (1.10.0)
+- click (6.7)
+- cryptography (2.0.3)
+- cssselect (1.0.1)
+- enum34 (1.1.6)
+- Flask (0.11.1)
+- gevent (1.1.2)
+- greenlet (0.4.12)
+- httplib2 (0.9.2)
+- idna (2.6)
+- ipaddress (1.0.18)
+- itsdangerous (0.24)
+- Jinja2 (2.9.6)
+- kafka-python (1.3.1)
+- lxml (3.6.4)
+- MarkupSafe (1.0)
+- parsel (1.2.0)
+- pip (9.0.1)
+- pyasn1 (0.3.3)
+- pyasn1-modules (0.1.1)
+- pycparser (2.18)
+- PyDispatcher (2.0.5)
+- pyOpenSSL (17.2.0)
+- python-dateutil (2.5.3)
+- queuelib (1.4.2)
+- requests (2.11.1)
+- Scrapy (1.1.2)
+- service-identity (17.0.0)
+- setuptools (36.4.0)
+- simplejson (3.8.2)
+- six (1.10.0)
+- Twisted (16.4.0)
+- virtualenv (15.1.0)
+- w3lib (1.18.0)
+- Werkzeug (0.12.2)
+- wheel (0.29.0)
+- zope.interface (4.4.2)
diff --git a/core/actionProxy/actionproxy.py b/core/python2Action/actionproxy.py
similarity index 100%
rename from core/actionProxy/actionproxy.py
rename to core/python2Action/actionproxy.py
diff --git a/core/python2Action/build.gradle b/core/python2Action/build.gradle
index a7a3f61e..ca5fb2f6 100644
--- a/core/python2Action/build.gradle
+++ b/core/python2Action/build.gradle
@@ -4,7 +4,6 @@ distDocker.dependsOn 'copyFiles'
 distDocker.finalizedBy 'rmFiles'
 
 def runners = files(
-    new File(project(':core:actionProxy').projectDir, 'actionproxy.py'),
     new File(project(':core:pythonAction').projectDir, 'pythonrunner.py')
 )
 
diff --git a/core/actionProxy/invoke.py b/core/python2Action/invoke.py
similarity index 100%
rename from core/actionProxy/invoke.py
rename to core/python2Action/invoke.py
diff --git a/core/pythonAction/CHANGELOG.md b/core/pythonAction/CHANGELOG.md
new file mode 100644
index 00000000..278e93eb
--- /dev/null
+++ b/core/pythonAction/CHANGELOG.md
@@ -0,0 +1,50 @@
+# Python 3 OpenWhisk Runtime Container
+
+
+
+## 1.0.0
+Change: Initial release
+
+Python version = 3.6.1
+
+- asn1crypto (0.23.0)
+- attrs (17.2.0)
+- Automat (0.6.0)
+- beautifulsoup4 (4.5.3)
+- cffi (1.11.1)
+- click (6.7)
+- constantly (15.1.0)
+- cryptography (2.0.3)
+- cssselect (1.0.1)
+- Flask (0.12)
+- gevent (1.2.1)
+- greenlet (0.4.12)
+- httplib2 (0.10.3)
+- idna (2.6)
+- incremental (17.5.0)
+- itsdangerous (0.24)
+- Jinja2 (2.9.6)
+- kafka-python (1.3.4)
+- lxml (3.7.3)
+- MarkupSafe (1.0)
+- parsel (1.2.0)
+- pip (9.0.1)
+- pyasn1 (0.3.7)
+- pyasn1-modules (0.1.4)
+- pycparser (2.18)
+- PyDispatcher (2.0.5)
+- pyOpenSSL (17.3.0)
+- python-dateutil (2.6.0)
+- queuelib (1.4.2)
+- requests (2.13.0)
+- Scrapy (1.3.3)
+- service-identity (17.0.0)
+- setuptools (36.5.0)
+- simplejson (3.10.0)
+- six (1.11.0)
+- Twisted (17.1.0)
+- virtualenv (15.1.0)
+- w3lib (1.18.0)
+- Werkzeug (0.12.2)
+- wheel (0.29.0)
+- zope.interface (4.4.3)
diff --git a/core/pythonAction/Dockerfile b/core/pythonAction/Dockerfile
index 1c1345c6..017df095 100644
--- a/core/pythonAction/Dockerfile
+++ b/core/pythonAction/Dockerfile
@@ -1,5 +1,5 @@
 # Dockerfile for python actions, overrides and extends ActionRunner from actionProxy
-FROM dockerskeleton
+FROM openwhisk/dockerskeleton:1.0.0
 
 RUN apk add --no-cache \
         bzip2-dev \
diff --git a/core/pythonAction/build.gradle b/core/pythonAction/build.gradle
index 0149b709..f3a57241 100644
--- a/core/pythonAction/build.gradle
+++ b/core/pythonAction/build.gradle
@@ -1,3 +1,2 @@
 ext.dockerImageName = 'python3action'
 apply from: '../../gradle/docker.gradle'
-distDocker.dependsOn ':core:actionProxy:distDocker'
diff --git a/settings.gradle b/settings.gradle
index 9a27b319..09cf4fa7 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,26 +1,17 @@
-include 'common:scala'
+def owPath = System.getenv("OPENWHISK_HOME") ?: '../open'
+def owDirectory = new File(owPath)
 
-include 'core:controller'
-include 'core:invoker'
-include 'core:nodejsActionBase'
-include 'core:nodejs6Action'
-include 'core:actionProxy'
-include 'core:pythonAction'
-include 'core:python2Action'
-include 'core:swift3Action'
-include 'core:swift3.1.1Action'
-include 'core:javaAction'
-include 'core:php7.1Action'
-
-include 'tools:cli'
-
-include 'sdk:docker'
+include 'common:scala'; project(':common:scala').projectDir = new File(owDirectory, 'common/scala')
+include 'core:controller'; project(':core:controller').projectDir = new File(owDirectory, 'core/controller')
+include 'core:invoker'; project(':core:invoker').projectDir = new File(owDirectory, 'core/invoker')
+include 'whisktests'; project(':whisktests').projectDir = new File(owDirectory, 'tests')
 
 include 'tests'
-include 'tests:dat:blackbox:badaction'
-include 'tests:dat:blackbox:badproxy'
 
-rootProject.name = 'openwhisk'
+include 'core:pythonAction'
+include 'core:python2Action'
+
+rootProject.name = 'runtime-python'
 
 gradle.ext.scala = [
     version: '2.11.8',
diff --git a/tests/build.gradle b/tests/build.gradle
index 6fa5a66e..124229c2 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -2,13 +2,13 @@ apply plugin: 'scala'
 apply plugin: 'eclipse'
 compileTestScala.options.encoding = 'UTF-8'
 
+evaluationDependsOn(':whisktests')
+
 repositories {
     mavenCentral()
 }
 
 tasks.withType(Test) {
-    systemProperties(System.getProperties())
-
     testLogging {
         events "passed", "skipped", "failed"
         showStandardStreams = true
@@ -17,63 +17,12 @@ tasks.withType(Test) {
     outputs.upToDateWhen { false } // force tests to run every time
 }
 
-task testLean(type: Test) {
-    exclude '**/*Swift*'
-    exclude '**/*Python*'
-    exclude '**/*Java*'
-    exclude '**/*ThrottleTests*'
-    exclude '**/MaxActionDurationTests*'
-    exclude '**/*ApiGwTests*'
-}
-
-// Add all images needed for local testing here
-test.dependsOn([
-    ':core:nodejs6Action:distDocker',
-    ':core:actionProxy:distDocker',
-    ':core:pythonAction:distDocker',
-    ':core:python2Action:distDocker',
-    ':core:javaAction:distDocker',
-    ':core:swift3Action:distDocker',
-    ':core:swift3.1.1Action:distDocker',
-    ':sdk:docker:distDocker',
-    ':tests:dat:blackbox:badaction:distDocker',
-    ':tests:dat:blackbox:badproxy:distDocker'
-])
-
 dependencies {
     compile "org.scala-lang:scala-library:${gradle.scala.version}"
-    compile 'org.apache.commons:commons-lang3:3.3.2'
-    compile 'org.apache.httpcomponents:httpclient:4.5.2:tests'
-    compile 'org.apache.httpcomponents:httpmime:4.3.6'
-    compile 'junit:junit:4.11'
-    compile 'com.jayway.restassured:rest-assured:2.6.0'
-    compile 'org.scalatest:scalatest_2.11:3.0.1'
-    compile 'com.typesafe.akka:akka-testkit_2.11:2.5.4'
-    compile 'com.google.code.gson:gson:2.3.1'
-    compile 'org.scalamock:scalamock-scalatest-support_2.11:3.4.2'
-    compile 'com.typesafe.akka:akka-testkit_2.11:2.4.16'
-    compile 'com.typesafe.akka:akka-http-testkit_2.11:10.0.10'
-    compile 'com.github.java-json-tools:json-schema-validator:2.2.8';
-
-    compile project(':common:scala')
-    compile project(':core:controller')
-    compile project(':core:invoker')
+    compile project(':whisktests')
+    compile project(':whisktests').sourceSets.test.output
 }
 
 tasks.withType(ScalaCompile) {
     scalaCompileOptions.additionalParameters = gradle.scala.compileFlags
 }
-
-def keystorePath = new File(sourceSets.test.scala.outputDir, 'keystore')
-task deleteKeystore(type: Delete) {
-    delete keystorePath
-}
-task createKeystore(dependsOn: deleteKeystore) {
-    doLast {
-        Properties props = new Properties()
-        props.load(new FileInputStream(file('../whisk.properties')))
-        def cmd = ['keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', file(props['whisk.ssl.cert']), '-keystore', keystorePath, '-storepass', 'openwhisk']
-        cmd.execute().waitForProcessOutput(System.out, System.err)
-    }
-}
-compileTestScala.finalizedBy createKeystore
diff --git a/tests/src/test/scala/actionContainers/ActionContainer.scala b/tests/src/test/scala/actionContainers/ActionContainer.scala
index 94f6763e..56aa1314 100644
--- a/tests/src/test/scala/actionContainers/ActionContainer.scala
+++ b/tests/src/test/scala/actionContainers/ActionContainer.scala
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package actionContainers
+package runtime.actionContainers
 
 import java.io.ByteArrayOutputStream
 import java.io.File
diff --git a/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala b/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
index 1ec8e9f8..1471d121 100644
--- a/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package actionContainers
+package runtime.actionContainers
 
 import java.io.File
 import java.util.Base64
diff --git a/tests/src/test/scala/actionContainers/Python2ActionContainerTests.scala b/tests/src/test/scala/actionContainers/Python2ActionContainerTests.scala
index 1740401f..312361d6 100644
--- a/tests/src/test/scala/actionContainers/Python2ActionContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/Python2ActionContainerTests.scala
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package actionContainers
+package runtime.actionContainers
 
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
diff --git a/tests/src/test/scala/actionContainers/PythonActionContainerTests.scala b/tests/src/test/scala/actionContainers/PythonActionContainerTests.scala
index 1e4f1bc4..afabc3e9 100644
--- a/tests/src/test/scala/actionContainers/PythonActionContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/PythonActionContainerTests.scala
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package actionContainers
+package runtime.actionContainers
 
 import org.junit.runner.RunWith
 import org.scalatest.junit.JUnitRunner
diff --git a/tests/src/test/scala/actionContainers/ResourceHelpers.scala b/tests/src/test/scala/actionContainers/ResourceHelpers.scala
index 3041e0ea..08f46e4f 100644
--- a/tests/src/test/scala/actionContainers/ResourceHelpers.scala
+++ b/tests/src/test/scala/actionContainers/ResourceHelpers.scala
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-package actionContainers
+package runtime.actionContainers
 
 import java.net.URI
 import java.net.URLClassLoader
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
new file mode 100755
index 00000000..aacbf95e
--- /dev/null
+++ b/tools/travis/build.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+set -ex
+
+# Build script for Travis-CI.
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+WHISKDIR="$ROOTDIR/../openwhisk"
+
+export OPENWHISK_HOME=$WHISKDIR
+
+IMAGE_PREFIX="testing"
+
+# Build runtime
+cd $ROOTDIR
+TERM=dumb ./gradlew \
+:core:python2Action:distDocker :core:pythonAction:distDocker \
+-PdockerImagePrefix=${IMAGE_PREFIX}
+
+
+# Build OpenWhisk
+cd $WHISKDIR
+
+#pull down images
+docker pull openwhisk/controller
+docker tag openwhisk/controller ${IMAGE_PREFIX}/controller
+docker pull openwhisk/invoker
+docker tag openwhisk/invoker ${IMAGE_PREFIX}/invoker
+docker pull openwhisk/nodejs6action
+docker tag openwhisk/nodejs6action ${IMAGE_PREFIX}/nodejs6action
+
+#Build CLI
+TERM=dumb ./gradlew \
+:tools:cli:distDocker \
+-PdockerImagePrefix=${IMAGE_PREFIX}
+
+
+
diff --git a/tools/travis/deploy.sh b/tools/travis/deploy.sh
new file mode 100755
index 00000000..bf300634
--- /dev/null
+++ b/tools/travis/deploy.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+set -ex
+
+# Build script for Travis-CI.
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+WHISKDIR="$ROOTDIR/../openwhisk"
+
+export OPENWHISK_HOME=$WHISKDIR
+
+IMAGE_PREFIX="testing"
+
+# Deploy OpenWhisk
+cd $WHISKDIR/ansible
+ANSIBLE_CMD="ansible-playbook -i ${ROOTDIR}/ansible/environments/local -e docker_image_prefix=${IMAGE_PREFIX}"
+$ANSIBLE_CMD setup.yml
+$ANSIBLE_CMD prereq.yml
+$ANSIBLE_CMD couchdb.yml
+$ANSIBLE_CMD initdb.yml
+$ANSIBLE_CMD wipe.yml
+$ANSIBLE_CMD openwhisk.yml
+
+docker images
+docker ps
+
+cat $WHISKDIR/whisk.properties
+curl -s -k https://172.17.0.1 | jq .
+curl -s -k https://172.17.0.1/api/v1 | jq .
+
+#Deployment
+WHISK_APIHOST="172.17.0.1"
+WHISK_AUTH=`cat ${WHISKDIR}/ansible/files/auth.guest`
+WHISK_CLI="${WHISKDIR}/bin/wsk -i"
+
+${WHISK_CLI} property set --apihost ${WHISK_APIHOST} --auth ${WHISK_AUTH} 
+${WHISK_CLI} property get
+
+
diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh
new file mode 100755
index 00000000..842970cc
--- /dev/null
+++ b/tools/travis/publish.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+set -eux
+
+# Build script for Travis-CI.
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+WHISKDIR="$ROOTDIR/../openwhisk"
+
+export OPENWHISK_HOME=$WHISKDIR
+
+IMAGE_PREFIX=$1
+RUNTIME_VERSION=$2
+IMAGE_TAG=$3
+
+if [ ${RUNTIME_VERSION} == "2" ]; then
+  RUNTIME="python2Action"
+elif [ ${RUNTIME_VERSION} == "3" ]; then
+  RUNTIME="pythonAction"
+fi
+
+if [[ ! -z ${DOCKER_USER} ]] && [[ ! -z ${DOCKER_PASSWORD} ]]; then
+docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
+fi
+
+if [[ ! -z ${RUNTIME} ]]; then
+TERM=dumb ./gradlew \
+:core:${RUNTIME}:distDocker \
+-PdockerRegistry=docker.io \
+-PdockerImagePrefix=${IMAGE_PREFIX} \
+-PdockerImageTag=${IMAGE_TAG}
+fi
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
new file mode 100755
index 00000000..adf859af
--- /dev/null
+++ b/tools/travis/setup.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+
+# Build script for Travis-CI.
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+HOMEDIR="$SCRIPTDIR/../../../"
+
+# OpenWhisk stuff
+cd $HOMEDIR
+git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk
+cd openwhisk
+./tools/travis/setup.sh
+
diff --git a/tools/travis/test.sh b/tools/travis/test.sh
new file mode 100755
index 00000000..226c62e5
--- /dev/null
+++ b/tools/travis/test.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -ex
+
+# Build script for Travis-CI.
+
+SCRIPTDIR=$(cd $(dirname "$0") && pwd)
+ROOTDIR="$SCRIPTDIR/../.."
+WHISKDIR="$ROOTDIR/../openwhisk"
+
+export OPENWHISK_HOME=$WHISKDIR
+
+cd ${ROOTDIR}
+TERM=dumb ./gradlew :tests:checkScalafmtAll
+TERM=dumb ./gradlew :tests:test --tests *Python*Tests
+
+
+
-- 
GitLab