Hello, I would like to know if (my code below)
pipeline {
agent linux-node
is the same as (the solution provided)
pipeline {
agent {
label "node01"
}
My pipeline is successful and the exercise is marked as passed. So, this is just for my understanding on the correct way to specify an agent.
Thanks
TBH, I’m not sure – the docs don’t make clear under what circumstances agent linux-node
would be satisfied, but since it didn’t cause an error in your case, I’m not sure what the declaration requires, or if it’s just ignored in this case. Assignment by label looks clear to me. This might be dependent upon how the lab is configured for all I know.
OK, clear from the lab. If you’ve defined linux-node as a permanent build agent, you can specify it as an argument to agent. I’d say that your style is therefore equivalent in that configuration.