Re: Jenkins selected filtering values in parameter objects

2022-10-27 Thread Chennai Cheetah
hi db,

I tried with xml api  below is my url

https://jenkins.myrepo.com/job/architecture-shared-services/job/loanrules_sit/api/xml?tree=builds[number,url,result,actions[parameters[name,value]]]=true=//parameter[name=%27rulesetid%27%20and%20value=%27635aa36a3f80310ae7e36c87%27]=builds

It returns 



rulesetid
635aa36a3f80310ae7e36c87



How do I get number, url, result tags in the response?


On Thursday, 27 October 2022 at 20:36:01 UTC+5:30 db...@cloudbees.com wrote:

> On Thu, Oct 27, 2022 at 3:39 PM Chennai Cheetah  
> wrote:
>
>> How do I get only selected jenkins information from the API response.
>>
> …
>>
> How do I filter rulesetid,branch details only from the parameter object, 
>> while rest of the parameters are not required in the response.
>>
> Work with the XML API output and use an XPath expression, or process the 
> JSON API responses using a tool like jq.
>

-- 
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/36146459-3b3f-4063-866f-1b008c97b9b1n%40googlegroups.com.


Re: Exception compiling code ONLY when running through Jenkins

2022-10-27 Thread Arnaud bourree
Does your build requires display?
Did you try on your linux without display set?

Regardes,

Arnaud

Le ven. 28 oct. 2022, 05:52, patnlo  a écrit :

> I have what should be a simple project, using msbuild for VS2019 to build
> a particular configuration of my solution. When I run in Visual Studio it
> works. When I run via msbuild from the command line it works. When I try to
> build the project using MSbuild in Jenkins it fails. When I try to run
> msbuild via a command prompt through Jenkins it fails. It gives me the "
> error : Exception has been thrown by the target of an invocation." every
> time.
>
> The developers don't have any idea how to fix it because it never fails
> from Visual Studio, only when the job is sent from Jenkins. FYI, I can
> rebuild this entire solution for my windows release through Jenkins with no
> issues. It only fails when trying to compile our VisualGDB platform for my
> linux configurations. And again, only fails when the compile is started by
> Jenkins.
>
> I'm stumped.
>
> --
> 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/7b686d72-5349-4c44-95fd-775c4080b00fn%40googlegroups.com
> 
> .
>

-- 
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/CAESUf_DiAB%2B8HtyTgE%3Djv8q_w_QpmguKNRPCx3z3L1MzvX6qtg%40mail.gmail.com.


Exception compiling code ONLY when running through Jenkins

2022-10-27 Thread patnlo
I have what should be a simple project, using msbuild for VS2019 to build a 
particular configuration of my solution. When I run in Visual Studio it 
works. When I run via msbuild from the command line it works. When I try to 
build the project using MSbuild in Jenkins it fails. When I try to run 
msbuild via a command prompt through Jenkins it fails. It gives me the " 
error : Exception has been thrown by the target of an invocation." every 
time. 

The developers don't have any idea how to fix it because it never fails 
from Visual Studio, only when the job is sent from Jenkins. FYI, I can 
rebuild this entire solution for my windows release through Jenkins with no 
issues. It only fails when trying to compile our VisualGDB platform for my 
linux configurations. And again, only fails when the compile is started by 
Jenkins.

I'm stumped.

-- 
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/7b686d72-5349-4c44-95fd-775c4080b00fn%40googlegroups.com.


Re: Jenkins selected filtering values in parameter objects

2022-10-27 Thread 'Daniel Beck' via Jenkins Users
On Thu, Oct 27, 2022 at 3:39 PM Chennai Cheetah 
wrote:

> How do I get only selected jenkins information from the API response.
>
> …
>
> How do I filter rulesetid,branch details only from the parameter object,
> while rest of the parameters are not required in the response.
>
Work with the XML API output and use an XPath expression, or process the
JSON API responses using a tool like jq.

-- 
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/CAMo7PtJOoPVU9Lop%2BTFL9%2BEALVF2uVgcewkEp240DxCp%2BVBGHA%40mail.gmail.com.


Jenkins selected filtering values in parameter objects

2022-10-27 Thread Chennai Cheetah


How do I get only selected jenkins information from the API response.

I tried with the below url

*https://myorg.com/job/architecture-shared-services/job/myrepo/api/json?tree=builds[number,url,result,actions[parameters[name,value]]]=true{0,2}
 
*

and it returned almost all data present in the build details.

How do I filter rulesetid,branch details only from the parameter object, 
while rest of the parameters are not required in the response.

Below is my API Response


{ "_class": "org.jenkinsci.plugins.workflow.job.WorkflowJob", "builds": [ { 
"_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", "actions": [ { 
"_class": "hudson.model.ParametersAction", "parameters": [ { "_class": 
"hudson.model.TextParameterValue", "name": "rulesetid", "value": 
"62e11268999630f4a49295c4" }, { "_class": 
"hudson.model.TextParameterValue", "name": "environment", "value": "sit" }, 
{ "_class": "hudson.model.TextParameterValue", "name": "tranid", "value": 
"1234" } ] }, { "_class": 
"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" } ], "number": 
243, "result": "SUCCESS", "url": 
"https://jenkins.myrepodigital.com/job/architecture-shared-services/job/myrepoio-io-rmaappetite_sit/243/;
 
}, { "_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", "actions": 
[ { "_class": "hudson.model.ParametersAction", "parameters": [ { "_class": 
"hudson.model.TextParameterValue", "name": "branch", "value": "sit" }, { 
"_class": "hudson.model.TextParameterValue", "name": "environment", 
"value": "sit" }, { "_class": "hudson.model.TextParameterValue", "name": 
"tranid", "value": "12345" } ] }, { "_class": 
"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction" } ], "number": 
243, "result": "SUCCESS", "url": 
"https://jenkins.myrepodigital.com/job/architecture-shared-services/job/myrepoio-io-rmaappetite_sit/243/;
 
} ] }

-- 
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/222db3a9-6f64-4b91-b63c-77cf03ead939n%40googlegroups.com.


[JobDSL plugin] Configure buildRetention in organizationFolder

2022-10-27 Thread Bruno Galindro da Costa
How can I configure buildRetention in organizationFolder job type 
using JobDSL plugin? Is it supported?

I could easily do it in a multibranchPipelineJob but I didn't find a way to 
do it in organizationFolder.

This is how I did in multibranchPipelineJob:

multibranchPipelineJob('my-job') {
branchSources {
branchSource {
strategy {
allBranchesSame {
props {
buildRetention {
buildDiscarder {
strategy {
logRotator {
daysToKeepStr('3')
numToKeepStr('5')
artifactDaysToKeepStr('3')
artifactNumToKeepStr('5')
}
}
}
}
}
}
}
}
}
}


My env is:

Jenkins version: 2.346.3
JobDSL plugin version: 1.79

-- 
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/d3caa2e9-c88d-4cfc-8f4a-bd89af4f4e4cn%40googlegroups.com.


Private jar file in a shared library

2022-10-27 Thread Jochen Wiedmann

Hi,

reading through https://www.jenkins.io/doc/book/pipeline/shared-libraries/
I get the impression, that @Grab is bound to a (possibly local) Maven 
repository. Which is alright, if I am using jar files from Maven central, 
or something like that.

In my case, I'd much rather do something like

  @Grab('lib/myPrivate.jar')

Is that possible, or must I impose the shared library users to somehow 
create a local Maven repository?

And, while we're at it: Is it possible, to distribute the shared library as 
a zip file, or whatever, rather than as a Git repository?


Thanks,

Jochen

P.S: In case, you are asking: I anicipate, that a lot of shared library 
consumers will be in a secure environment, with no access to external 
repositories.



-- 
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/46c11068-51f3-48de-a0c5-11e9b926429dn%40googlegroups.com.