Hi,
I want to test my project in several platforms: Ubuntu, CentOS, Debian, etc. I have created some docker slaves in jenkins for each platform. My jenkins file looks like:
def labels = ['DockerSlaveXenial', 'DockerSlaveTrusty']
def stage1() {
checkout scm
sh 'ls -l'
}
def stage2() {
sh 'ls -lah'
sh 'echo hi'
}
for (x in labels) {
def label = x
node(label) {
stage ('Checkout source'){
stage1()
}
stage ('Tests'){
stage2()
}
}
}
It is working, it is executing the 2 stages in each node (docker slave). I have 3 questions:
- Is this the proper way to do it?.
- in Stage View I see a table with 4 columns: Checkout source, Tests, Checkout source, Tests. Meaning two columns (checkout source and tests) for each node. How can I group the test by node and stage?.
- On the other hand, I can't execute it with parallel because I can't use parallel with stages. How can I execute it parallely?
Thanks.
Regards.