Assuming the node h...
 
Notifications
Clear all

Assuming the node has been appropriately labeled, "apache", how would you ensure this stage ran on that node?

1 Posts
1 Users
0 Likes
180 Views
(@salterslloyd)
Noble Member
Joined: 2 years ago
Posts: 746
Topic starter  

You're a DevOps engineer in charge of your team's Jenkins server. You have a particular stage in your pipeline that you want to run on a particular build node. You have to have Apache installed on this node.

Assuming the node has been appropriately labeled, "apache", how would you ensure this stage ran on that node?

  • A . apache agent
  • B . agent { label 'apache' }
  • C . agent( 'apache' )
  • D . apache' { agent }

Show Answer Hide Answer

Suggested Answer: B

Explanation:

Example: stage('deploy') { agent { label 'apache' } steps { sh "if ![ -d '/var/www/html/rectangles/all/${env.BRANCH_NAME}' ]; then mkdir /var/www/html/rectangles/all/${env.BRANCH_NAME}; fi" sh "cp dist/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/${env.BRANCH_NAME}/" }

   
Quote

Latest CloudBees CJE Dumps Valid Version

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund
Share: