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 [email protected].
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 via email to