declarative pipeline: agents

22 views
Skip to first unread message

Hicham Mouline

unread,
Jul 14, 2025, 3:00:08 PMJul 14
to Jenkins Users
It appears to me a jenkins pipeline file uses pipeline as the top level block, and inside there are sections like stages, and post.

I extend a template file that is given to me that looks like this

pipeline {
  agent none
  parameters {....}
  {% block environment %}
  {% endblock environment %}
  stages {
    ...
  }
 {% block post_actions %}
  post {
     ...
  }
  {% endblock %}
}


I'm interest to set a agent for post to select  where post runs.


If the top level agent was templated, I would have been able to replace the 

'agent none' with a warlock agent of my choice and that would apply to post too, but I can't

Can agent appear more than once in top level pipeline? where 2nd appearance of agent overrides the previous one?

post doesnt' allow agent inside it right?


Reply all
Reply to author
Forward
0 new messages