Fixes #4228 -- move downstream builders to travis (#4250)

* Fixes #4228 -- move downstream builders to travis

* Use upstream twisted now that we've confirmed the problem
diff --git a/.travis.yml b/.travis.yml
index 5fa92db..cbbff3b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -48,6 +48,21 @@
         - python: 3.4
           env: TOXENV=py3pep8
 
+        - python: 2.7
+          env: DOWNSTREAM=pyopenssl
+        - python: 2.7
+          env: DOWNSTREAM=twisted
+        - python: 2.7
+          env: DOWNSTREAM=paramiko
+        - python: 2.7
+          env: DOWNSTREAM=aws-encryption-sdk
+        - python: 2.7
+          env: DOWNSTREAM=certbot
+        - python: 2.7
+          env: DOWNSTREAM=certbot-josepy
+        - python: 2.7
+          env: DOWNSTREAM=urllib3
+
 install:
     - ./.travis/install.sh
 
diff --git a/.travis/run.sh b/.travis/run.sh
index c190372..ed23725 100755
--- a/.travis/run.sh
+++ b/.travis/run.sh
@@ -13,9 +13,68 @@
 
     export PATH="$HOME/$OPENSSL_DIR/bin:$PATH"
     export CFLAGS="-I$HOME/$OPENSSL_DIR/include"
-    # rpath on linux will cause it to use an absolute path so we don't need to do LD_LIBRARY_PATH
+    # rpath on linux will cause it to use an absolute path so we don't need to
+    # do LD_LIBRARY_PATH
     export LDFLAGS="-L$HOME/$OPENSSL_DIR/lib -Wl,-rpath=$HOME/$OPENSSL_DIR/lib"
 fi
 
 source ~/.venv/bin/activate
-tox
+
+if [ -n "${TOXENV}" ]; then
+    tox
+else
+    pip install .
+    case "${DOWNSTREAM}" in
+        pyopenssl)
+            git clone --depth=1 https://github.com/pyca/pyopenssl
+            cd pyopenssl
+            pip install -e ".[test]"
+            pytest tests
+            ;;
+        twisted)
+            git clone --depth=1 https://github.com/twisted/twisted
+            cd twisted
+            pip install -e .[tls,conch,http2]
+            python -m twisted.trial src/twisted
+            ;;
+        paramiko)
+            git clone --depth=1 https://github.com/paramiko/paramiko
+            cd paramiko
+            pip install -e .
+            pip install -r dev-requirements.txt
+            inv test
+            ;;
+        aws-encryption-sdk)
+            git clone --depth=1 https://github.com/awslabs/aws-encryption-sdk-python
+            cd aws-encryption-sdk-python
+            pip install -r test/requirements.txt
+            pip install -e .
+            pytest -m local -l
+            ;;
+        certbot)
+            git clone --depth=1 https://github.com/certbot/certbot
+            cd certbot
+            pip install pytest pytest-mock mock
+            pip install -e acme
+            pip install -e .
+            pytest certbot/tests
+            pytest acme
+            ;;
+        certbot-josepy)
+            git clone --depth=1 https://github.com/certbot/josepy
+            cd josepy
+            pip install -e ".[tests]"
+            pytest src
+            ;;
+        urllib3)
+            git clone --depth 1 https://github.com/shazow/urllib3
+            cd urllib3
+            pip install -r ./dev-requirements.txt
+            pip install -e ".[socks]"
+            pytest test
+            ;;
+        *)
+            exit 1
+            ;;
+    esac
+fi
diff --git a/Jenkinsfile b/Jenkinsfile
index ca49527..44e9ab9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -103,114 +103,6 @@
     )
 }
 
-def downstreams = [
-    [
-        downstreamName: 'pyOpenSSL',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/pyca/pyopenssl
-            cd pyopenssl
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install -e .[test]
-            pytest tests
-        """
-    ],
-    [
-        downstreamName: 'Twisted',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/twisted/twisted
-            cd twisted
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install pyopenssl service_identity pycrypto
-            pip install -e .
-            python -m twisted.trial src/twisted
-        """
-    ],
-    [
-        downstreamName: 'paramiko',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/paramiko/paramiko
-            cd paramiko
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install -e .
-            pip install -r dev-requirements.txt
-            inv test
-        """
-    ],
-    [
-        downstreamName: 'aws-encryption-sdk',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/awslabs/aws-encryption-sdk-python
-            cd aws-encryption-sdk-python
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install -r test/requirements.txt
-            pip install -e .
-            pytest -m local -l
-        """
-    ],
-    [
-        downstreamName: 'certbot',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/certbot/certbot
-            cd certbot
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install pytest pytest-mock mock
-            pip install -e acme
-            pip install -e .
-            pytest certbot/tests
-            pytest acme
-        """
-    ],
-    [
-        downstreamName: 'certbot-josepy',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth=1 https://github.com/certbot/josepy
-            cd josepy
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install -e .[tests]
-            pytest src
-        """
-    ],
-    [
-        downstreamName: 'urllib3',
-        label: 'docker',
-        imageName: 'pyca/cryptography-runner-ubuntu-rolling',
-        script: """#!/bin/bash -xe
-            git clone --depth 1 https://github.com/shazow/urllib3
-            cd urllib3
-            virtualenv .venv
-            source .venv/bin/activate
-            pip install ../cryptography
-            pip install -r ./dev-requirements.txt
-            pip install -e .[socks]
-            pytest test
-        """
-    ],
-]
-
 def checkout_git(label) {
     retry(3) {
         def script = ""
@@ -423,26 +315,4 @@
     }
 }
 
-for (downstream in downstreams) {
-    def downstreamName = downstream["downstreamName"]
-    def imageName = downstream["imageName"]
-    def label = downstream["label"]
-    def script = downstream["script"]
-    builders[downstreamName] = {
-        node(label) {
-            docker.image(imageName).inside {
-                try {
-                    timeout(time: 30, unit: 'MINUTES') {
-                        checkout_git(label)
-                        sh script
-                    }
-                } finally {
-                    deleteDir()
-                }
-            }
-        }
-    }
-}
-
 parallel builders
-