Call parallel stages from a loaded file

2022-05-23 Thread chencho m-a
Hi all, 

I have this piece of code

def s
def workspace
pipeline {
  agent { label 'build_1804' }

  stages {
stage('load functions') {
  steps {
script{
  workspace = env.WORKSPACE
  node('build_1804') {
s = load "${workspace}/regress/Jenkins_extension.groovy"   
  }
}
  }
}

stage('Build and Test 1') {
steps{
  script{
s.buildandtest1(this)
  }
}
 }
  }
}

And other file with:
def buildandtest1(Object s) {
  parallel {
echo "Building test"
echo "Calling test script..."
sh """
  cd regress
  echo \"./do_standalone_wo_resnet50_2_58.sh\"
"""
  }
}

}
}

Dont put too much attention in {} or other syntax errors, i have modified 
the code to do it more readable. 

The main problem is that seems that jenkins is not able to start "parallel" 
stages when it is called from a method. I am getting this error. 

java.lang.IllegalArgumentException: Expected named arguments but got 
org.jenkinsci.plugins.workflow.cps.CpsClosure2@6a6de064at 
org.jenkinsci.plugins.workflow.cps.DSL.singleParam(DSL.java:718)at 
org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:706)at 
org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:640)at 
org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:234)


I have googled, but i dont find any solution or clue to fix it.

What am i missing ?

-- 
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/66e7b2c8-2090-4770-8c6a-140241c057abn%40googlegroups.com.


Re: DevOps World 2022: Looking for Jenkins proposals

2022-05-23 Thread Alyssa Tong
Friendly reminder the CFP is closing in 2 days, May 25 - We would love to
receive more Jenkins proposals.

BR,
alyssa

On Mon, Apr 25, 2022 at 1:03 PM Alyssa Tong  wrote:

> I sent this out via community Discourse and thought I'd include it here as
> well.
>
> Hello,
>
> The Jenkins project will be attending DevOps World
> ,
> live and in person in Orlando, Florida, September 28-29, 2022. We will host
> a Jenkins contributor summit. The program will have a track dedicated to
> community topics, with many Jenkins sessions.  If you have a Jenkins story
> that will inspire others pls submit your talk for consideration, the CFP
> is open until May 12
> 
> .
>
> If you would like to be on the community review committee pls let me know.
>
> Thanks,
> alyssa
>

-- 
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/CAC9wNaxQ3hY%2BaZQrzECfKjOayeub2QnVh6KTPRkO0Z9COaA%2B8g%40mail.gmail.com.


Re: Git Source Code Management Oddity

2022-05-23 Thread eric....@gmail.com
Also note that I AM using the "with credentials" from the plugin.

On Thursday, May 19, 2022 at 8:56:30 AM UTC-6 Mark Waite wrote:

> On Thursday, May 19, 2022 at 8:42:29 AM UTC-6 Eric Fetzer wrote:
>
>> OK, I've been having some major issues with Git source code management in 
>> Jenkins.  So I have several repositories I pull from to do builds.  I use 
>> my same credentials to pull from each.  If the pull succeeds, I push a tag 
>> at it.  I was noticing certain tags were failing saying it already existed 
>> even though it didn't exist.  Well, it didn't exist in THAT repository.  
>> But it did exist in one of the other repositories.  I tested by creating 
>> these tags in git command line and pushing them and it worked fine.  Anyone 
>> have a clue what could be happening here?  The jenkins task goes to my 
>> repository's url with my credentials selecting from the branch I tell it.  
>> It's set to clean before check out.  It does all of this fine.  It has a 
>> Git Publisher post build step to push my tag only if the checkout succeeds 
>> with the box checked to create new tag.  This works UNLESS that same tags 
>> exists in any of the projects I run this checkout task against.  Can anyone 
>> think of a reason for this odd behavior?  Thanks!!!
>
>
> I don't know if the git publisher in the git plugin is able to handle 
> checkout from multiple repositories.  It may not be that sophisticated.
>
> You may need to switch to use the "with credentials" feature that was 
> added in Google Summer of Code 2021 to allow you to perform the push of the 
> tag yourself rather than using the git publisher.  Docs on the "with 
> credentials" feature are available at 
> https://plugins.jenkins.io/git/#plugin-content-credential-binding 
> (Pipeline) and https://plugins.jenkins.io/git/#plugin-content-git-bindings 
> (freestyle) 
>
> Mark Waite
>

-- 
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/3978fa1d-ca63-44f3-9966-123ce7fc7ccbn%40googlegroups.com.


Re: Git Source Code Management Oddity

2022-05-23 Thread eric....@gmail.com
It handles checkout from multiple repositories and pushes tags to each.  
The only issue is that it seems to see tags in other repositories when it 
should only see the tags in the repository in question.  If the tag exists 
in ANY of the repositories I build for, this will be the error:

using credential e9cc840b-9e32-416c-94e7-7b23c1afbd5e 
 > git tag -l 2.3.0.1.1 
# timeout=10 ERROR: Step ‘Git Publisher’ failed: Tag 2.3.0.1.1 already 
exists and Create Tag is specified, so failing.

Any clue how I would trouble shoot such a thing?

Thanks,
Eric

On Thursday, May 19, 2022 at 8:56:30 AM UTC-6 Mark Waite wrote:

> On Thursday, May 19, 2022 at 8:42:29 AM UTC-6 Eric Fetzer wrote:
>
>> OK, I've been having some major issues with Git source code management in 
>> Jenkins.  So I have several repositories I pull from to do builds.  I use 
>> my same credentials to pull from each.  If the pull succeeds, I push a tag 
>> at it.  I was noticing certain tags were failing saying it already existed 
>> even though it didn't exist.  Well, it didn't exist in THAT repository.  
>> But it did exist in one of the other repositories.  I tested by creating 
>> these tags in git command line and pushing them and it worked fine.  Anyone 
>> have a clue what could be happening here?  The jenkins task goes to my 
>> repository's url with my credentials selecting from the branch I tell it.  
>> It's set to clean before check out.  It does all of this fine.  It has a 
>> Git Publisher post build step to push my tag only if the checkout succeeds 
>> with the box checked to create new tag.  This works UNLESS that same tags 
>> exists in any of the projects I run this checkout task against.  Can anyone 
>> think of a reason for this odd behavior?  Thanks!!!
>
>
> I don't know if the git publisher in the git plugin is able to handle 
> checkout from multiple repositories.  It may not be that sophisticated.
>
> You may need to switch to use the "with credentials" feature that was 
> added in Google Summer of Code 2021 to allow you to perform the push of the 
> tag yourself rather than using the git publisher.  Docs on the "with 
> credentials" feature are available at 
> https://plugins.jenkins.io/git/#plugin-content-credential-binding 
> (Pipeline) and https://plugins.jenkins.io/git/#plugin-content-git-bindings 
> (freestyle) 
>
> Mark Waite
>

-- 
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/7623d7a2-3618-4f9f-aeaf-65179b601cd5n%40googlegroups.com.