2018-06-13 19:57:04 +00:00
|
|
|
pipeline {
|
|
|
|
agent { label 'kitchen-slave' }
|
2018-07-17 18:21:19 +00:00
|
|
|
options {
|
2018-07-17 18:26:37 +00:00
|
|
|
timestamps()
|
|
|
|
ansiColor('xterm')
|
2018-07-17 18:21:19 +00:00
|
|
|
}
|
2018-06-13 19:57:04 +00:00
|
|
|
environment {
|
|
|
|
SALT_KITCHEN_PLATFORMS = "/var/jenkins/workspace/platforms.yml"
|
|
|
|
SALT_KITCHEN_DRIVER = "/var/jenkins/workspace/driver.yml"
|
|
|
|
PATH = "/usr/local/rbenv/shims/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin"
|
|
|
|
RBENV_VERSION = "2.4.2"
|
|
|
|
TEST_SUITE = "py2"
|
|
|
|
TEST_PLATFORM = "centos-7"
|
2018-07-17 19:57:00 +00:00
|
|
|
PY_COLORS = 1
|
2018-06-13 19:57:04 +00:00
|
|
|
}
|
|
|
|
stages {
|
2018-06-19 22:55:05 +00:00
|
|
|
stage('github-pending') {
|
|
|
|
steps {
|
|
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
|
|
description: "running ${TEST_SUITE}-${TEST_PLATFORM}...",
|
|
|
|
status: 'PENDING',
|
|
|
|
context: "jenkins/pr/${TEST_SUITE}-${TEST_PLATFORM}"
|
|
|
|
}
|
|
|
|
}
|
2018-06-13 19:57:04 +00:00
|
|
|
stage('setup') {
|
|
|
|
steps {
|
|
|
|
sh 'bundle install --with ec2 windows --without opennebula docker'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('run kitchen') {
|
|
|
|
steps {
|
|
|
|
script { withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
|
|
|
|
sshagent(credentials: ['jenkins-testing-ssh-key']) {
|
|
|
|
sh 'ssh-add ~/.ssh/jenkins-testing.pem'
|
|
|
|
sh 'bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM || bundle exec kitchen converge $TEST_SUITE-$TEST_PLATFORM'
|
|
|
|
sh 'bundle exec kitchen verify $TEST_SUITE-$TEST_PLATFORM'
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
script { withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', accessKeyVariable: 'AWS_ACCESS_KEY_ID', credentialsId: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
|
|
|
|
sshagent(credentials: ['jenkins-testing-ssh-key']) {
|
2018-06-27 22:05:14 +00:00
|
|
|
sh 'ssh-add ~/.ssh/jenkins-testing.pem'
|
2018-06-13 19:57:04 +00:00
|
|
|
sh 'bundle exec kitchen destroy $TEST_SUITE-$TEST_PLATFORM'
|
|
|
|
}
|
|
|
|
}}
|
2018-07-12 16:17:03 +00:00
|
|
|
archiveArtifacts artifacts: 'artifacts/xml-unittests-output/*.xml'
|
2018-07-31 19:04:19 +00:00
|
|
|
archiveArtifacts artifacts: 'artifacts/logs/minion'
|
2018-08-06 14:25:25 +00:00
|
|
|
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
|
2018-06-13 19:57:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
2018-06-29 18:07:08 +00:00
|
|
|
always {
|
2018-07-12 16:17:03 +00:00
|
|
|
junit 'artifacts/xml-unittests-output/*.xml'
|
2018-06-29 18:07:08 +00:00
|
|
|
cleanWs()
|
|
|
|
}
|
2018-06-13 19:57:04 +00:00
|
|
|
success {
|
2018-06-19 20:58:38 +00:00
|
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
|
|
description: "The ${TEST_SUITE}-${TEST_PLATFORM} job has passed",
|
|
|
|
status: 'SUCCESS',
|
|
|
|
context: "jenkins/pr/${TEST_SUITE}-${TEST_PLATFORM}"
|
2018-06-13 19:57:04 +00:00
|
|
|
}
|
|
|
|
failure {
|
2018-06-19 20:58:38 +00:00
|
|
|
githubNotify credentialsId: 'test-jenkins-credentials',
|
|
|
|
description: "The ${TEST_SUITE}-${TEST_PLATFORM} job has failed",
|
|
|
|
status: 'FAILURE',
|
|
|
|
context: "jenkins/pr/${TEST_SUITE}-${TEST_PLATFORM}"
|
2018-06-13 19:57:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|