Global pipeline library error with git parameter with additional 'origin' in ref spec?

2017-10-25 Thread kevmando
Hi,

I'm using global pipeline library and git parameter to 
choose jenkins pipeline script as below.

It has worked fine, but it starts to act weirdly today and I'm not sure 
which plugins cause the issue.
I updated several plugins at the same time - actually downloaded updated 
plugins over a month, but restarted today.

You will see the first git fetch has normal refspec, but the next one has 
additional 'origin' in its refspec.
I don't know why it is added and where to report.

Any info or workaround would be welcome.

Loading library global-util-library@origin/master
 > git rev-parse --is-inside-work-tree # timeout=10
Setting origin to MYGITHUB URL
 > git config remote.origin.url MYGITHUB URL # timeout=10

Fetching origin...
Fetching upstream changes from origin
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Service account for Github and Jenkins* > 
git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/**
 > git rev-parse origin/master^{commit} # timeout=10
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url MYGITHUB URL # timeout=10
Fetching without tags
Fetching upstream changes from MYGITHUB URL
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Service account for Github and Jenkins* > 
git fetch --no-tags --progress MYGITHUB URL 
+refs/heads/origin/master:refs/remotes/origin/origin/master*

ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
:
 Failed to fetch from MYGITHUB URL
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:817)  


 




Pipeline code

//Set environment values by user selection
println "using global-util-library@${params.JENKINS_BRANCH_NAME}"
library "global-util-library@${params.JENKINS_BRANCH_NAME}" 


Git parameter setting





-- 
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/74f4d695-10bc-4cc5-a2ec-95d163d1f6f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Can Shared library call another shared library (from /vars to /vars)

2017-04-25 Thread kevmando
Hi,

I'm trying to consolidate common steps and stages into shared library under 
vars folder. (global variable/function)

However, I got a problem with this while I'm writing too many small steps 
in separate groovy files under /vars folder, then try to use them in stage 
level script.

Is it possible to call other scripts into a new script?

I think it seems possible on src folder which has class files, but can't 
find how to do same thing on global variable/functions.

-- 
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/7a6f82d7-c7a4-4f33-b801-76118e2eeb71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Active Choices plugin - not found referenced parameter

2017-03-13 Thread kevmando
Hi,

I'm trying to use Active Choices plugin to get branch list by repo using 
github api, but it gives me an error that there is no repo - which is a 
referenced parameter, which is already defined.

In case, I'm using Ubuntu 16.0.4, Jenkins 2.32.2 and Active choices plugin 
1.5.3.

if (REPO.equals("REPOA")){
def proc = "curl 
https://api.github.com/repos/jenkinsci/active-choices-plugin/branches | jq 
-r '[.[] | .name ]'".execute()
return proc.text
}
else if (REPO.equals("REPOB")){
def proc = "curl 
https://api.github.com/repos/jenkinsci/active-choices-plugin/branches | jq 
-r '[.[] | .name ]' ".execute()
return proc.text
}




Am I doing something wrong?

(I also tried to use buffer/stream way since I found some answers about not 
using 'text' from stackoverflow, but same result. the code part to get 
branch name is working fine on scriptler edit mode.)

def proc ="curl"
def outputStream = new StringBuffer()
proc.waitForProcessOutput(outputStream, System.err)
return outputStream.toString())
referenced parameter reactive part



The error is as follow:

Fallback to default script...
groovy.lang.MissingPropertyException: No such property: REPO for class:  
Script1
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(
ScriptBytecodeAdapter.java:53)
at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(
PogoGetPropertySite.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.
callGroovyObjectGetProperty(AbstractCallSite.java:307)
at Script1.run(Script1.groovy:1)



-- 
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/9c6cec1e-0848-46a0-b754-9a0241c67d76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.