I have YAML file:
accounts:
- account1: compute
owners:- user1
- user2
- user3
- account2: storage
owners:- user4
- user5
- user6
- account3 : network
owners:- user4
- user5
- user6
I read this Yaml file in jenkins and I need check if account is compute and owner is different then user1, user2, user3 then terminate the pipeline if it match, go to next step.
I tried with if condition but checks only first value.
Thanks in advance.
config.accounts.each { sa ->
sa.owners.each { owner ->
if (owner != "user1") {
error('Terminating Pipeline...')
}
}
}```
New contributor
Mahmut Cuta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.