There is one simple tutorial that I was looking for on the web, and I could not find it.
So I wrote it myself.
Jenkins has matrix builds, and Jenkins has agent Docker for builds inside a docker image.
Combined, these features make it easy to test a project with multiple versions of PHP for example.
So here is the simple example I came up with: Put this in your Jenkinsfile and you are done.
pipeline {
agent none
stages {
stage('BuildAndTest') {
matrix {
agent {
docker { image "${DOCKER_IMAGE}" }
}
axes {
axis {
name 'DOCKER_IMAGE'
values 'php:5.3', 'php:5.6'
}
}
stages {
stage('Build') {
steps {
echo "Do Build for ${DOCKER_IMAGE}"
sh 'php --version'
}
}
}
}
}
}
}
Let me know if it helps you: I am on twitter: @oracle2020
