Jenkins Infinite Loop w/ Powershell evoked from Groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins Infinite Loop w/ Powershell evoked from Groovy

Joe Cavanaugh
Set up :

1) Create a Pipeline script in a groovy file such as in the blog post https://jenkins.io/blog/2017/10/02/pipeline-templates-with-shared-libraries/ . I called mine dotNetApiPipeline.groovy and saved it to /vars.
def call(body) {
     // evaluate the body block, and collect configuration into the object
     def pipelineParams = [:]
     body.resolveStrategy = Closure.DELEGATE_FIRST
     body.delegate = pipelineParams
     body() 

     pipeline {
         agent {
             node {
                 label 'master'
             }
         } 
         stages {
             stage('Powershell Test') {
                 steps {
                     powershell 'Write-Output "Hello World"'
                     powershell 'Write-Output "$env:COMPONENTVERSION"' 
                 }
             }
         }
 
      }
}


2) Invoke the script via your pipeline job. 
@Library("Jenkins_Library@powershellTest") _
dotNetApiPipeline {
    COMPONENTVERSION = "0.0.0"
}
 
Weirdly enough it just stuck in an infinite loop on the first powershell call. I noticed in the example they are using only shell scripts and I am making a test for bat files as well. I'm wondering if anyone else is seeing this issue with attempting to make pipeline libraries. 

Thanks,
Joe
 
 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ea108194-f6bf-4eaa-94a7-8d3802577026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Infinite Loop w/ Powershell evoked from Groovy

Joe Cavanaugh

Forgot to mention - the version of Jenkins is 2.98 with all the latest and greatest plugin versions (I just updated yesterday 12/28/2017). It is a windows master build machine running powershell 3.0 and I haven't tested on a powershell 5.1 machine yet. 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1dcac49b-f0f7-449e-81cd-64dd01493566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Infinite Loop w/ Powershell evoked from Groovy

Joe Cavanaugh
I can now confirm the standard bat 'echo Hello World' works fine - it is just the powershell keyword that is an issue. 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2a5ebf65-8d9c-4bd6-a76f-0b4676d242f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins Infinite Loop w/ Powershell evoked from Groovy

Joe Cavanaugh
Anyone else encountering this issue? 

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b9c9f3ea-5f52-44aa-9c35-451be03baafb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.