I have a question regarding the execution of JSL scripts on the Jenkins 
Agent node. I noticed JSL scripts get executed only on Jenkins Master, is 
it possible to run the JSL script on Jenkins Agents?

I have multiple stages in my Pipeline and I wish to run those stages on 
different Jenkins Agent nodes. 

My primary motivation for using JSL is end-to-end Pipeline testability 
during development using “replay”, where I can modify Jenkinsfile as well 
as scripts from JSL.

This is a snippet of my Pipeline --

pipeline {
   agent { label 'scdc-generic-w10x64' }
   options {
      timestamps()
   }
   stages {
      stage('Log ip') {
        steps {
            script {
               bat "ipconfig -all"   // *** Gets executed on Jenkins Agent 
***
               foo = jsl.foo.new(this) // foo is a Groovy class in JSL
               foo.logIpAddress()   // *** Gets executed on Jenkins Master 
***
            }
         }
      }
   }
   post {
      always {
         cleanWs()
      }
   }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/60ad9bcd-1ee2-49b7-bbbd-951859b7d80en%40googlegroups.com.

Reply via email to