Reputation: 739
I am using mutli-configuration job with sequential execution. 2 axis: - slaves - user-defined
Jenkins run my jobs in "random" order.
Is there a way to fix that order? Why jenkins does not use the order of the used-defined variable (first line first)?
regards
Upvotes: 6
Views: 2058
Reputation: 364
It is possible to use the Matrix configuration sorter plugin
[1] for this. After installing the plugin, you get an option Execution order of builds
, with the following values to choose from:
Selecting the last option should order the jobs the way they are specified in the axis, though only for the last one.
[1] https://wiki.jenkins-ci.org/display/JENKINS/Matrix+configuration+sorter+plugin
Upvotes: 3
Reputation: 1867
According to page 267 of Jenkins: The Definitive Guide by John Smart, Jenkins will use the values of an axis in the same manner as parameter values, but when triggered the job will run once per axis value.
The order for these values is not fixed (and may be random; I'm not sure). Presumably the assumptions here are that there are enough build slaves that each permutation can be handled by a different slave and that the order of permutations does not matter. I say permutations because, if there is more than one axis, the total number of builds corresponds to the Cartesian product of the axes.
A multiple-axis scenario probably holds the answer to why there is no way to specify order in a user-defined axis: it would be complicated and, when the build slaves are distributed, not very useful. Jenkins simply doesn't care about axis ordering, for good reason. The simple case of one axis and one build slave, where ordering might actually matter, is essentially an edge case.
Upvotes: 2