fxapom/Jenkinsfile

111 строки
2.5 KiB
Plaintext
Исходник Обычный вид История

2018-02-22 22:11:27 +03:00
#!/usr/bin/env groovy
def branch = env.BRANCH_NAME ?: 'master'
2017-02-22 21:29:12 +03:00
/** Desired capabilities */
def capabilities = [
browserName: 'Firefox',
version: '66.0',
2017-03-01 12:54:11 +03:00
platform: 'Windows 10'
]
2017-02-22 21:29:12 +03:00
pipeline {
agent any
2017-08-07 21:44:44 +03:00
libraries {
lib('fxtest@1.10')
2017-08-07 21:44:44 +03:00
}
triggers {
pollSCM(branch == 'master' ? 'H/5 * * * *' : '')
cron(branch == 'master' ? 'H H * * *' : '')
}
2017-02-22 21:29:12 +03:00
options {
2017-03-14 21:33:39 +03:00
ansiColor('xterm')
2017-02-22 21:29:12 +03:00
timestamps()
timeout(time: 1, unit: 'HOURS')
}
2017-02-22 21:29:12 +03:00
environment {
PYTEST_PROCESSES = "${PYTEST_PROCESSES ?: "auto"}"
PYTEST_ADDOPTS =
"-n=${PYTEST_PROCESSES} " +
"--tb=short " +
"--color=yes " +
"--driver=SauceLabs " +
"--variables=capabilities.json"
PULSE = credentials('PULSE')
SAUCELABS = credentials('SAUCELABS')
}
2017-02-22 21:29:12 +03:00
stages {
stage('Lint') {
agent {
dockerfile true
}
2017-02-22 21:29:12 +03:00
steps {
sh "tox -e flake8"
}
}
2017-02-22 21:29:12 +03:00
stage('Test') {
parallel {
stage('py36') {
agent {
dockerfile true
}
steps {
writeCapabilities(capabilities, 'capabilities.json')
sh "tox -e py36"
}
post {
always {
stash includes: 'results/py36.html', name: 'py36'
archiveArtifacts 'results/*'
junit 'results/*.xml'
}
}
}
stage('py27') {
agent {
dockerfile true
}
steps {
writeCapabilities(capabilities, 'capabilities.json')
sh "tox -e py27"
}
post {
always {
stash includes: 'results/py27.html', name: 'py27'
archiveArtifacts 'results/*'
junit 'results/*.xml'
submitToActiveData('results/py27_raw.txt')
submitToTreeherder('fxapom', 'T', 'Tests', 'results/*', 'results/py27_tbpl.txt')
}
}
}
}
}
}
2017-02-22 21:29:12 +03:00
post {
always {
unstash 'py36'
unstash 'py27'
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'results',
reportFiles: "py36.html, py27.html",
reportName: 'HTML Report'])
}
changed {
ircNotification()
}
2017-02-22 21:29:12 +03:00
failure {
emailext(
attachLog: true,
attachmentsPattern: 'results/*.html',
body: '$BUILD_URL\n\n$FAILED_TESTS',
replyTo: '$DEFAULT_REPLYTO',
subject: '$DEFAULT_SUBJECT',
to: '$DEFAULT_RECIPIENTS')
2017-02-22 21:29:12 +03:00
}
}
}