Re: using ssh agent and github SCM

2017-10-19 Thread 'Jurgen Weber' via Jenkins Users
issue link: https://issues.jenkins-ci.org/browse/JENKINS-47463

-- 
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/1418cbaa-2b20-456e-8e40-a4eadf49a3ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to detect a merge and perform a cleanup action with multibranch pipelines

2017-10-19 Thread red 888


This is what I have now:

1. Create a feature branch with jenkinsfile in it
2. Commit to your new feature branch and the pipeline kicks off
3. The pipeline deploys the app to a new VM/environment/container/whatever
4. The environment/VM persists after the deploy so you can touch/test it 
physically

Now what I want to happen is when the branch is merged and deleted jenkins 
cleans up and deletes the VM it created for that branch.

Are there triggers for merge/deletion of a branch?

-- 
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/443b874e-8c4f-4a46-8cad-961b6f7b6904%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Checking if params.FOO is undefined

2017-10-19 Thread Robert Hales
There are a lot of different ways to do this, but it depends on how your 
pipeline script is written, whether you are using declarative or scripted 
pipeline, what do you want to do when it is null vs. not. In a scripted 
pipeline this is a basic programming question: 

if (params.FOO) {

} else {

}


On Thursday, October 19, 2017 at 10:24:23 AM UTC-6, jbr...@snapapp.com 
wrote:
>
> Hi all,
>
> Let's say I have a Jenkinsfile for a job that is normally built with Build 
> Parameters, and so has params.FOO in it. Then let's say that I want to also 
> be able to automatically build this using a  ultibranch pipeline job. 
> Obviously, params.FOO will be undefined, causing the job to fail; is it 
> possible to write the Jenkinsfile to check if a variable is undefined?
>
> Thanks!
> Jack
>

-- 
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/d36d4f8c-2605-4c23-8980-6660e8226d8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Linux jenkins .net core build appends windows paths to file locations

2017-10-19 Thread Hardtraxx
For future reference:

I solved the issue by passing the --runtime variable to the dotnet command 
in the build script.
For some reason this is required when building from Jenkins. Building from 
command line doesn't require using the --runtime variable.

-- 
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/58337835-67b3-4e68-b002-1fce36a30060%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: BlueOcean JavaScript Error

2017-10-19 Thread 'Mark Woodland' via Jenkins Users
I've submitted pull 
request https://github.com/jenkinsci/junit-plugin/pull/84 which should 
prevent the ClassCastException from happening.

On Thursday, 28 July 2016 14:29:52 UTC+1, John D. Ament wrote:
>
> Removing cucumber did fix it.
>
> On Thursday, July 28, 2016 at 7:11:02 AM UTC-4, John D. Ament wrote:
>>
>> Experimental update with Jenkins 2.15.  looks like a compatibility issue 
>> with cucumber though.
>
>

-- 
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/b4926bf9-756a-4da3-93be-8f0a664a08d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins.createProject - ACL

2017-10-19 Thread Shaun Thompson
Running into an issue where I'm programmatically creating a job when the 
user installs it's corresponding plugin.  The Jenkins instance has security 
enabled with either logged in users can do anything or matrix based 
security.

If those are set, it will fail with Anonymous does not have create access.  
How do I allow the job to create the project using the logged in user's 
abilities.

Thanks

-- 
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/893e85cf-a3ee-4ff1-91af-3b9b8dd9e814%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Checking if params.FOO is undefined

2017-10-19 Thread jbrooks
Hi all,

Let's say I have a Jenkinsfile for a job that is normally built with Build 
Parameters, and so has params.FOO in it. Then let's say that I want to also 
be able to automatically build this using a  ultibranch pipeline job. 
Obviously, params.FOO will be undefined, causing the job to fail; is it 
possible to write the Jenkinsfile to check if a variable is undefined?

Thanks!
Jack

-- 
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/172dd537-83d9-4850-9cdb-661377ae158a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread David Aldrich
Thanks for your answer.

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of jer...@bodycad.com
Sent: 19 October 2017 15:36
To: Jenkins Users 
Subject: Re: Declarative script: 'bat' command fails but job succeeds

Not sure about declarative pipeline (I haven't played with them yet). but for 
normal pipeline I use it this way:
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"

You can find the doc here:
https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#bat-windows-batch-script

returnStatus can be check or not if you want, if you don't want to end the 
script for warnings like my above example. You can then use msbuild parser for 
example
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: 
[[parserName: 'MSBuild']]])

--
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/0e30d94d-ccfc-4b72-b8a8-a7280ee99ce5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Click 
here
 to report this email as spam.

-- 
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/b24f8f98fef84fdeb8f879b5f8d33ac7%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.


Re: How to change the jenkins job status to PASS/FAIL?

2017-10-19 Thread Viacheslav Dubrovskyi

Hi Neel,

It depends what type of job do you have.

For pipeline you can look to this article 
https://support.cloudbees.com/hc/en-us/articles/218554077-How-to-set-current-build-result-in-Pipeline-



19.10.2017 16:31, Neel Desai пишет:

Hello All,


I want to change the status of my jenkins job based on the result of 
other parameter's value. How can I do that? I would prefer the through 
Jenkins REST API. If I can change with rest api, then it would be best 
solution.



THanks,
Neel Desai
--
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/c9f12e36-993a-4fc3-a4d7-63336bc36a72%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
WBD,
Viacheslav Dubrovskyi

--
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/3ecfced4-2845-91e4-bfbb-5f068e0813d6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread jerome
Not sure about declarative pipeline (I haven't played with them yet). but 
for normal pipeline I use it this way:
bat returnStatus: false, script: "\"${bcad.msbuild_current}\" 
${bcad.msbuild_solution_name} ${bcad.msbuild_default_arg} /t:Build"

You can find the doc here:
https://jenkins.io/doc/pipeline/steps/workflow-durable-task-step/#bat-windows-batch-script

returnStatus can be check or not if you want, if you don't want to end the 
script for warnings like my above example. You can then use msbuild parser 
for example
step([$class: 'WarningsPublisher', canRunOnFailed: true, consoleParsers: [[
parserName: 'MSBuild']]])

-- 
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/0e30d94d-ccfc-4b72-b8a8-a7280ee99ce5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to execute a jar file as a post build jenkins step?

2017-10-19 Thread itchymuzzle
What was the error?

-- 
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/9fbd3678-dc60-4f3b-94c6-9d0e99ed596c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to change the jenkins job status to PASS/FAIL?

2017-10-19 Thread Neel Desai
Hello All,


I want to change the status of my jenkins job based on the result of other 
parameter's value. How can I do that? I would prefer the through Jenkins 
REST API. If I can change with rest api, then it would be best solution.


THanks,
Neel Desai

-- 
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/c9f12e36-993a-4fc3-a4d7-63336bc36a72%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to execute a jar file as a post build jenkins step?

2017-10-19 Thread Neel Desai
Hello,

I've a jar file on my local machine. I have shell script ready to execute 
it. If I run that shell script locally, it works completely fine but 
whenever I try to run that from jenkins it gives me error. 

Just FYI,

In jenkins for now I am pointing a jar file location to my local machine's 
location.

#!/bin/bash
cd C://Users//XYZ//comparePFTRuns
mvn exec:java -Dexec.mainClass="com.example.MainClass"


Please let me know how can I do this?

Thanks,
Neel Desai

-- 
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/a1fe0bc1-3884-40f2-b616-375d8e53d37b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: AW: Help with NotSerializableException in pipeline

2017-10-19 Thread Viacheslav Dubrovskyi

Hi Reinhold,

Thank you for answer.

>I think it is the usage of the (default?) map in pipeline code, e.g. 
"def enviroments = [:]" which according to the StackTrace results in a 
LinkedHashMap?


Hm. If I use empty map suites_time = [:] in function sortSuites(), 
everything working good.


But all maps used only in @NonCPS functions. It's why I'm confused.

Will try to move some logic into  pipeline library.


19.10.2017 08:17, Reinhold Fuereder пишет:


Hi

I think it is the usage of the (default?) map in pipeline code, e.g. 
"def enviroments = [:]" which according to the StackTrace results in a 
LinkedHashMap?


According to 
https://jenkins.io/blog/2017/02/01/pipeline-scalability-best-practice/#appendix-serializable-vs.-non-serializable-types 
"Maps: normal Groovy Map, HashMap, TreeMap" are said to be okay though 
-- not sure if this is still up-to-date…


But maybe you wanted to use a List, or re-structure your pipeline code 
completely? Or moved some of the logic into a shared pipeline library 
instead?


Cu Reinhold

--
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/C3D41C0B1D5991438F1A43F586F4B47F7F8731D5%40TIGER2010.xortex.local 
.

For more options, visit https://groups.google.com/d/optout.


--
WBD,
Viacheslav Dubrovskyi

--
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/3fa0c4e3-a0e0-34c3-29e3-a257fca3bea4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Declarative script: 'bat' command fails but job succeeds

2017-10-19 Thread David Aldrich
Thanks very much for your reply.

> Take care batch error level only is valid for the last command and not a 
> cumulative flag.

Yes, that was exactly the issue.  I followed your advice and the script works 
correctly now.

> Also make sure you give the proper  bat argument returnStatus into your 
> pipeline scripts.

I partly understand this. Where should I specify the returnStatus argument? 
(Note this is declarative).

-- 
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/0b9060410d0947cea65a8179587d983b%40EUX13SRV1.EU.NEC.COM.
For more options, visit https://groups.google.com/d/optout.


Fwd: [jenkinsci-docs] jenkins reload configuration from disk using command line with google Login either Oauth2

2017-10-19 Thread Shrinivas Devarkonda
Hi Jenkins Users Group,

Kindly help us on this ticket "jenkins reload configuration from disk using
command line with google Login either Oauth2".

=

Hi All,

We are using jenkins with "configure global security" and Access Control
--> security Realm --> Login with google with client_id, client_secret and
google apps domain "ourdomain.com".

Everything is working fine , Email who are @ourdomain.com are able to
access jenkins.

We want to achieve following by using command line.

** We are changing deploy ips in config.xml from command line which is
effected in jenkins console ,so the solution is either reload or restart or
reload configuration from disk.

/etc/init.d/jenkins reload  ( this actually restarts jenkins , so we can
not use this ) ,

So only one way is "jenkins reload configuration from disk" either from
jenkins UI or command line.   From jenkins UI it works fine.

We need to do the same from command line.I tried by using below line
and it fails as Google Login Auth is required.

/etc/alternatives/java -jar jenkins-cli.jar -s http://10.10.1.7:8080
 reload-configuration
*error :* hudson.security.AccessDeniedException2: anonymous is missing the
Overall/Read permission


Please help us how to do this.

Thanks,
Shrinivas Devarkonda
Manager - DevOps.
email : shrinivas.devarko...@via.com


=




-- Forwarded message --
From: Jesse Glick 
Date: Wed, Oct 18, 2017 at 11:23 PM
Subject: Re: [jenkinsci-docs] jenkins reload configuration from disk using
command line with google Login either Oauth2
To: shrinivas.devarko...@via.com
Cc: jenkinsci-d...@googlegroups.com


I think you meant to use jenkinsci-users@googlegroups.com.

--
You received this message because you are subscribed to a topic in the
Google Groups "Jenkins Documentation" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/jenkinsci-docs/9_h88eBmaBg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
jenkinsci-docs+unsubscr...@googlegroups.com.
To post to this group, send email to jenkinsci-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-docs/CANfRfr1Q28H8oLYdZB9bEbD7pOBvY6LPH%3D7v_R5ayQG0CWQgrg%
40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



-- 

Thanks and Regards,

[image: via-com-logo.png (106×50)]

*Shrinivas Devarkonda*  |  Manager - Infrastructure .


*E:* shrinivas.devarko...@via.com  |  *M:* +91 - 9663361030.

-- 
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/CABmwRd%2BU8Tefr7ikdxyfj9MREw9oqEoK9nHmzcRXJKC%3DGBgGrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.