28 lines
697 B
Plaintext
28 lines
697 B
Plaintext
def list
|
|
pipeline {
|
|
agent {
|
|
label 'pipeline-agent'
|
|
}
|
|
|
|
stages {
|
|
stage('Create Job List') {
|
|
steps {
|
|
script {
|
|
// you may create your list here, lets say reading from a file after checkout
|
|
list = ["Test-1", "Test-2", "Test-3", "Test-4", "Test-5"]
|
|
}
|
|
}
|
|
}
|
|
stage('Dynamic Stages') {
|
|
steps {
|
|
script {
|
|
for(int i=0; i < list.size(); i++) {
|
|
stage(list[i]){
|
|
echo "Element: $i"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |