Pipeline in multiple OS platforms (docker slaves)

28 views
Skip to first unread message

Jesús Linares

unread,
Nov 9, 2016, 5:24:38 AM11/9/16
to Jenkins Users
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:
  1. Is this the proper way to do it?.
  2. 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?.
  3. 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.

Daniel Beck

unread,
Nov 9, 2016, 6:30:41 AM11/9/16
to jenkins...@googlegroups.com

> On 09.11.2016, at 11:24, Jesús Linares <jesusli...@gmail.com> wrote:
>
> • 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?
>

It seems you need to choose one or the other:

https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Stage+View+Plugin#PipelineStageViewPlugin-UsageNotes/Limits:

Jesús Linares

unread,
Nov 9, 2016, 11:19:26 AM11/9/16
to Jenkins Users, m...@beckweb.net
So, is there a better way to test my code in several docker slaves?.

Thanks.
Reply all
Reply to author
Forward
0 new messages