2019-11-22 13:50:19 +00:00
|
|
|
pipeline{
|
2019-12-11 13:55:40 +00:00
|
|
|
agent none
|
2019-11-22 13:50:19 +00:00
|
|
|
stages {
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Early checks') {
|
2019-12-11 13:55:40 +00:00
|
|
|
agent { node { label 'master' } }
|
|
|
|
stages {
|
2019-12-11 16:49:32 +00:00
|
|
|
stage ('Check for RFC/WIP builds') {
|
|
|
|
when {
|
|
|
|
changeRequest comparator: 'REGEXP', title: '.*(rfc|RFC|wip|WIP).*'
|
|
|
|
beforeAgent true
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
error("Failing as this is marked as a WIP or RFC PR.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Cancel older builds') {
|
2019-12-11 13:55:40 +00:00
|
|
|
steps {
|
|
|
|
cancelPreviousBuilds()
|
|
|
|
}
|
|
|
|
}
|
2019-11-22 13:50:19 +00:00
|
|
|
}
|
2019-05-23 15:45:13 +00:00
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Build') {
|
|
|
|
failFast true
|
|
|
|
parallel {
|
|
|
|
stage ('Master build') {
|
|
|
|
agent { node { label 'master' } }
|
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run Cargo tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --cargo"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage ('Run OpenAPI tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/run_openapi_tests.sh"
|
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
}
|
|
|
|
stage ('Worker build') {
|
|
|
|
agent { node { label 'bionic' } }
|
|
|
|
options {
|
|
|
|
timeout(time: 1, unit: 'HOURS')
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
stages {
|
|
|
|
stage ('Checkout') {
|
|
|
|
steps {
|
|
|
|
checkout scm
|
|
|
|
}
|
|
|
|
}
|
2020-02-17 15:07:01 +00:00
|
|
|
stage ('Run unit tests') {
|
|
|
|
steps {
|
|
|
|
sh "scripts/dev_cli.sh tests --unit"
|
|
|
|
}
|
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
stage ('Run integration tests') {
|
|
|
|
steps {
|
2020-02-10 15:19:49 +00:00
|
|
|
sh "scripts/dev_cli.sh tests --integration"
|
2020-02-07 16:56:08 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-11 07:49:06 +00:00
|
|
|
}
|
|
|
|
}
|
2019-12-11 13:55:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def cancelPreviousBuilds() {
|
|
|
|
// Check for other instances of this particular build, cancel any that are older than the current one
|
|
|
|
def jobName = env.JOB_NAME
|
|
|
|
def currentBuildNumber = env.BUILD_NUMBER.toInteger()
|
|
|
|
def currentJob = Jenkins.instance.getItemByFullName(jobName)
|
|
|
|
|
|
|
|
// Loop through all instances of this particular job/branch
|
|
|
|
for (def build : currentJob.builds) {
|
|
|
|
if (build.isBuilding() && (build.number.toInteger() < currentBuildNumber)) {
|
|
|
|
echo "Older build still queued. Sending kill signal to build number: ${build.number}"
|
|
|
|
build.doStop()
|
2019-11-22 13:50:19 +00:00
|
|
|
}
|
2019-05-23 15:45:13 +00:00
|
|
|
}
|
2020-02-07 16:56:08 +00:00
|
|
|
}
|