Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Jenkinsfile for jenkins job configuration #108

Merged
merged 10 commits into from
Apr 28, 2017
64 changes: 64 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
def configs = [
[
label: 'windows',
toxenvs: ['py26', 'py27', 'py33', 'py34', 'py35', 'py36'],
],
[
label: 'windows64',
toxenvs: ['py26', 'py27', 'py33', 'py34', 'py35', 'py36'],
],
[
label: 'freebsd11',
toxenvs: ['py27'],
],
]

def build(label, toxenv) {
try {
timeout(time: 5, unit: 'MINUTES') {
if (label.startsWith("windows")) {
bat """
@set PATH="C:\\Python27";"C:\\Python27\\Scripts";%PATH%
tox -r -e $toxenv
"""
} else {
ansiColor('xterm') {
sh "tox -r -e $toxenv -- --color=yes"
}
}
}
} catch (e) {
currentBuild.result = 'FAILURE'
throw e
} finally {
deleteDir()
}

}

def builders = [:]
for (config in configs) {
def label = config["label"]
def toxenvs = config["toxenvs"]

// We need to use a temporary variable here and then
// bind it in the for loop so that it is properly captured
// by the closure
for (_toxenv in toxenvs) {
def toxenv = _toxenv
def combinedName = "${label}-${toxenv}"

builders[combinedName] = {
node(label) {
stage("Checkout") {
checkout scm
}
stage(combinedName) {
build(label, toxenv)
}
}
}
}
}

parallel builders
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include src/build_bcrypt.py
recursive-include src/_csrc *
recursive-include tests *.py

exclude requirements.txt tasks.py .travis.yml wheel-scripts
exclude requirements.txt tasks.py .travis.yml wheel-scripts Jenkinsfile

recursive-exclude wheel-scripts *

Expand Down