From ff4a8788ec5b24981031c394a88f88b2f382d8c3 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 25 May 2019 11:36:15 -0400 Subject: Strip out unused paths for Jenkinsfile (#4894) This includes removing the docs-upload builder. I was the only one using it, and it will be hard to port to Azure. --- Jenkinsfile | 172 ++++++++++++++++++------------------------------------------ 1 file changed, 52 insertions(+), 120 deletions(-) (limited to 'Jenkinsfile') diff --git a/Jenkinsfile b/Jenkinsfile index 9fb9ad15..8a989bf1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,13 +11,6 @@ def configs = [ label: 'windows64', toxenvs: ['py27', 'py34', 'py35', 'py36', 'py37'], ], - [ - label: 'docker', - imageName: 'pyca/cryptography-runner-sid', - toxenvs: ['docs'], - artifacts: 'cryptography/docs/_build/html/**', - artifactExcludes: '**/*.doctree', - ], ] def checkout_git(label) { @@ -54,17 +47,10 @@ def checkout_git(label) { ]) } } - if (label.contains("windows")) { - bat """ - cd cryptography - git rev-parse HEAD - """ - } else { - sh """ - cd cryptography - git rev-parse HEAD - """ - } + bat """ + cd cryptography + git rev-parse HEAD + """ } def build(toxenv, label, imageName, artifacts, artifactExcludes) { try { @@ -84,89 +70,52 @@ def build(toxenv, label, imageName, artifacts, artifactExcludes) { withCredentials([string(credentialsId: 'cryptography-codecov-token', variable: 'CODECOV_TOKEN')]) { withEnv(["LABEL=$label", "TOXENV=$toxenv", "IMAGE_NAME=$imageName"]) { - if (label.contains("windows")) { - def pythonPath = [ - py27: "C:\\Python27\\python.exe", - py34: "C:\\Python34\\python.exe", - py35: "C:\\Python35\\python.exe", - py36: "C:\\Python36\\python.exe", - py37: "C:\\Python37\\python.exe" - ] - if (toxenv == "py35" || toxenv == "py36" || toxenv == "py37") { - opensslPaths = [ - "windows": [ - "include": "C:\\OpenSSL-Win32-2015\\include", - "lib": "C:\\OpenSSL-Win32-2015\\lib" - ], - "windows64": [ - "include": "C:\\OpenSSL-Win64-2015\\include", - "lib": "C:\\OpenSSL-Win64-2015\\lib" - ] - ] - } else { - opensslPaths = [ - "windows": [ - "include": "C:\\OpenSSL-Win32-2010\\include", - "lib": "C:\\OpenSSL-Win32-2010\\lib" - ], - "windows64": [ - "include": "C:\\OpenSSL-Win64-2010\\include", - "lib": "C:\\OpenSSL-Win64-2010\\lib" - ] + def pythonPath = [ + py27: "C:\\Python27\\python.exe", + py34: "C:\\Python34\\python.exe", + py35: "C:\\Python35\\python.exe", + py36: "C:\\Python36\\python.exe", + py37: "C:\\Python37\\python.exe" + ] + if (toxenv == "py35" || toxenv == "py36" || toxenv == "py37") { + opensslPaths = [ + "windows": [ + "include": "C:\\OpenSSL-Win32-2015\\include", + "lib": "C:\\OpenSSL-Win32-2015\\lib" + ], + "windows64": [ + "include": "C:\\OpenSSL-Win64-2015\\include", + "lib": "C:\\OpenSSL-Win64-2015\\lib" ] - } - bat """ - cd cryptography - @set PATH="C:\\Python27";"C:\\Python27\\Scripts";%PATH% - @set PYTHON="${pythonPath[toxenv]}" - - @set INCLUDE="${opensslPaths[label]['include']}";%INCLUDE% - @set LIB="${opensslPaths[label]['lib']}";%LIB% - tox -r -- --wycheproof-root=../wycheproof - IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% - virtualenv .codecov - call .codecov/Scripts/activate - REM this pin must be kept in sync with tox.ini - pip install coverage - pip install codecov - codecov -e JOB_BASE_NAME,LABEL,TOXENV - """ - } else if (label.contains("sierra") || label.contains("yosemite")) { - ansiColor { - sh """#!/usr/bin/env bash - set -xe - # Jenkins logs in as a non-interactive shell, so we don't even have /usr/local/bin in PATH - export PATH="/usr/local/bin:\${PATH}" - export PATH="/Users/jenkins/.pyenv/shims:\${PATH}" - cd cryptography - CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 \ - LDFLAGS="/usr/local/opt/openssl\\@1.1/lib/libcrypto.a /usr/local/opt/openssl\\@1.1/lib/libssl.a" \ - CFLAGS="-I/usr/local/opt/openssl\\@1.1/include -Werror -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=unused-function -Wno-error=unused-command-line-argument -mmacosx-version-min=10.9" \ - tox -r -- --color=yes --wycheproof-root=../wycheproof - virtualenv .venv - source .venv/bin/activate - # This pin must be kept in sync with tox.ini - pip install coverage - bash <(curl -s https://codecov.io/bash) -e JOB_BASE_NAME,LABEL,TOXENV - """ - } + ] } else { - ansiColor { - sh """#!/usr/bin/env bash - set -xe - cd cryptography - tox -r -- --color=yes --wycheproof-root=../wycheproof - virtualenv .venv - source .venv/bin/activate - # This pin must be kept in sync with tox.ini - pip install coverage - bash <(curl -s https://codecov.io/bash) -e JOB_BASE_NAME,LABEL,TOXENV,IMAGE_NAME - """ - } - if (artifacts) { - archiveArtifacts artifacts: artifacts, excludes: artifactExcludes - } + opensslPaths = [ + "windows": [ + "include": "C:\\OpenSSL-Win32-2010\\include", + "lib": "C:\\OpenSSL-Win32-2010\\lib" + ], + "windows64": [ + "include": "C:\\OpenSSL-Win64-2010\\include", + "lib": "C:\\OpenSSL-Win64-2010\\lib" + ] + ] } + bat """ + cd cryptography + @set PATH="C:\\Python27";"C:\\Python27\\Scripts";%PATH% + @set PYTHON="${pythonPath[toxenv]}" + + @set INCLUDE="${opensslPaths[label]['include']}";%INCLUDE% + @set LIB="${opensslPaths[label]['lib']}";%LIB% + tox -r -- --wycheproof-root=../wycheproof + IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL% + virtualenv .codecov + call .codecov/Scripts/activate + REM this pin must be kept in sync with tox.ini + pip install coverage + pip install codecov + codecov -e JOB_BASE_NAME,LABEL,TOXENV + """ } } } @@ -185,28 +134,11 @@ for (config in configs) { for (_toxenv in toxenvs) { def toxenv = _toxenv - - if (label.contains("docker")) { - def imageName = config["imageName"] - def combinedName = "${imageName}-${toxenv}" - builders[combinedName] = { - node(label) { - stage(combinedName) { - def buildImage = docker.image(imageName) - buildImage.pull() - buildImage.inside { - build(toxenv, label, imageName, artifacts, artifactExcludes) - } - } - } - } - } else { - def combinedName = "${label}-${toxenv}" - builders[combinedName] = { - node(label) { - stage(combinedName) { - build(toxenv, label, '', null, null) - } + def combinedName = "${label}-${toxenv}" + builders[combinedName] = { + node(label) { + stage(combinedName) { + build(toxenv, label, '', null, null) } } } -- cgit v1.2.3