Re: Proxy for branch indexing in multibranch pipeline

2016-04-29 Thread Lionel Orellana

Upgrading from 1.656 to 2.0 fixed it.

The GitHub Branch Source Plugin is probably what made the difference. I was 
using a Git (as opposed to GitHub) branch source before.

On Friday, 29 April 2016 15:51:58 UTC+10, Lionel Orellana wrote:
>
> Hi
>
> I have a proxy configured in my Jenkins settings (Manage Plugins -> 
> Advanced). 
>
> I'm pretty sure this is what makes freestyle jobs and Pipelines set the 
> proxy before connecting to github. 
>
> Here's the output from a Pipeline job:
>
>  > /opt/rh/devtoolset-2/root/usr/bin/git config --local credential.helper 
> store --file=/tmp/git7252640829815953814.credentials # timeout=10*Setting 
> http proxy: serverproxy:8080*
>
>  > /opt/rh/devtoolset-2/root/usr/bin/git -c core.askpass=true fetch --tags 
> --progress https://github.com//*.git 
>  
> +refs/heads/*:refs/remotes/origin/*
>
>
> But when I try to run the indexing job in a Multibranch pipeline it fails 
> to connect to github. It seems to me it is not setting the proxy.
>
> FATAL: Failed to recompute children of Debt Agreement Service Pipeline
>
> hudson.plugins.git.GitException 
> :
>  org.eclipse.jgit.api.errors.TransportException: 
> https://github.com/*/*.git 
> : cannot open git-upload-pack
>   at 
> org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:680) 
> 
>   at 
> jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:174)
>  
> 
>   at jenkins.scm.api.SCMSource.fetch(SCMSource.java:146) 
> 
>   at 
> jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:296)
>  
> 
>   at 
> com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:151)
>  
> 
>   at 
> com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:122)
>  
> 
>   at hudson.model.ResourceController.execute(ResourceController.java:98) 
> 
>   at hudson.model.Executor.run(Executor.java:410) 
> 
> Caused by: org.eclipse.jgit.api.errors.TransportException 
> :
>  https://github.com/**/***.git 
> : cannot open git-upload-pack
>   at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:139) 
> 
>   at 
> org.jenkinsci.plugins.gitclient.JGitAPIImpl.fetch(JGitAPIImpl.java:678) 
> 
>   ... 7 more
> Caused by: org.eclipse.jgit.errors.TransportException 
> :
>  https://github.com/*/**.git 
> : cannot open git-upload-pack
>   at 
> org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:524) 
> 
>   at 
> org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:309) 
> 
>   at 
> org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136) 
> 
>   at 
> org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122) 
> 
>   at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1138) 
> 
>   at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:130) 
> 

Re: Jenkins Pipeline: How to fail on junit results

2016-04-29 Thread Craig Rodrigues
Take a look at this and see if it helps:

https://github.com/freebsd/freebsd-ci/blob/master/scripts/build/build-test.groovy#L227

If you call JUnitArchiver from inside a pipeline, I think it
throws an exception if there is a test failure.
You need to catch the exception, explicitly set currentBuild.result to
FAILURE,
and then re-throw the exception.

It took me a long time to figure it out. :)

--
Craig


On Thu, Apr 7, 2016 at 1:17 AM, Frank Hask  wrote:

> Hi all,
>
> i am creating build pipeline and i am stuck at the integration tests stage.
>
> This stage generates junit test results in XML format and if there are
> some failures pipeline just ignores it and continue as usual. But i want to
> stop pipeline and mark it as failure on test failure.
>
> I have exhausted all possible ways so i am posting this topic in hope that
> someone has figured this out and wants to share it with community.
>
> --
> 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/7f0fde36-5c82-4fe4-8aa0-65e47f8aa379%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAG%3DrPVd5%2BbkOEjyi1QfRTKS-8rDykdzFpz%2BbpYCGaGoL8i_vgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins job output values

2016-04-29 Thread Baptiste Mathus
Hi,

No standard way to my knowledge. Or possibly write a simple plugin that
would do that parsing from the log or the FS as you say, or whatever, and
would expose a RESTish API.

My 2 cents.

2016-04-29 1:32 GMT+02:00 Alan Evangelista :

> Hi.
>
> I execute a Jenkins job remotely via the Jenkins API and I need to get one
> or more return values
> from the Jenkins build. Is there any way to define, when running a build,
> a custom return value
> which will be returned by the Jenkins API ? What are the alternatives? The
> ones I currently see:
>
> - writing a file with the output in a system accessible by Jenkins server
> and the caller.
>   Caller downloads the file after the build is complete and extracts
> output values from it.
>
> - writing output to stdout. Caller gets build console output via Jenkins
> API and extracts
>   output values from it.
>
> Anything else? What is the standard way to do this?
>
>
> Regards,
> Alan Evangelista
>
> --
> 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/57229D7D.3000707%40linux.vnet.ibm.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Jenkins Pipeline: How to fail on junit results

2016-04-29 Thread John Long
You can use the junit reporting plugin 
 to do this. Once 
you've installed it, you can call it with code like this:
step([$class: 'JUnitResultArchiver', keepLongStdio: true, testResults: 
'target/test-reports/TEST*.xml'])

The snippet creator can help you when you select "step: General Build Step".

On Thursday, April 7, 2016 at 1:17:21 AM UTC-7, Frank Hask wrote:
>
> Hi all,
>
> i am creating build pipeline and i am stuck at the integration tests stage.
>
> This stage generates junit test results in XML format and if there are 
> some failures pipeline just ignores it and continue as usual. But i want to 
> stop pipeline and mark it as failure on test failure.
>
> I have exhausted all possible ways so i am posting this topic in hope that 
> someone has figured this out and wants to share it with community.
>

-- 
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/789fcaf9-ffc7-46e8-9e2e-cfd57dacef48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkinsfile to clone a remote repository

2016-04-29 Thread Kohsuke Kawaguchi
What Antonio said, or also see
https://www.cloudbees.com/blog/jenkins-workflow-using-global-library-implement-re-usable-function-call-secured-http-endpoint
which
is a part of the pipeline suite.

On Thu, Apr 28, 2016 at 3:15 PM Jeeva Chelladhurai  wrote:

> Hello All,
>
> I am planning to organize my source code in one github repository, and the
> Jenkinsfile and the configuration/topology file in a different github
> repository.. Would it be possible to clone/check out the remote repository
> using my Jenkinsfile? I tried something as show below but it does not seem
> to be working... Your help is greatly appreciated ..
>
> node ('docker') {
> stage "SCM Synch"
> checkout scm
>
> stage "Main Src"
> git url: 'https://github.com//.git'
> checkout scm
>
> stage "Next Stage"
> sh "echo yet to write"
>
> }
>
>
>
> Thanks,
> Jeeva
>
> --
> 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/46730175-e8d4-4d68-aadf-16fb3e170ea7%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAN4CQ4w91ySyHGr64PURQHJzcjuE2SzF_%3DBYkfhi-9cN%2Bic8Hg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Bind Usergroup to specified node(s)/slave(s)?

2016-04-29 Thread 'Dan Steffen' via Jenkins Users
Hello,

excuse my late response the Job Restrictions Plugin was exactly that was i 
looking for. Thanks for your help
best regards
Dan

-- 
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/58ea4917-530e-4f34-9c23-8bba0af44092%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: build trigger condition on checkin

2016-04-29 Thread Tom Moore


On Friday, April 29, 2016 at 10:55:18 AM UTC-4, Hector Magnanao wrote:
>
> I’m using PTC Integrity for my SCM tool, do you have any suggestions on 
> that ?
>
>  
>

I've never used the PTC Integrity CM plugin, so I'm only able to guess 
based off the wiki:  
https://wiki.jenkins-ci.org/display/JENKINS/PTC+Integrity+Plugin

I see an include and exclude option under the advanced options.   The wiki 
doesn't describe their purpose, but if they work the same as the Subversion 
and Git plugins, then those would be the fields to put your regexes into 
for conditional checkout testing.Like I said, I've never used this 
plugin and don't use PTC Integrity, so you'll have to experiment from there.

-- 
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/a7e9c0ba-d80d-4aeb-95a5-56a7c93e0adf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


JDK Installer Groovy script

2016-04-29 Thread Stijn Diependaele
Dear,

I'm trying to write a groovy script which manages the JDK installs. 

The code below would set the JDK installation with the home folder. 
Although I would like to us an automatic installation from Oracle.
You have to set the username and password for this. But how do i pass the 
username and password to the Descriptor of JDKInstaller?

If I look at 
http://javadoc.jenkins-ci.org/hudson/tools/JDKInstaller.DescriptorImpl.html 
I can see that you can getUsername an getPassword. 
A guess would be it's done by passing it through JSON in the configure 
method???

Could anyone provide a code example? 

JDKDesc = Jenkins.instance.getDescriptorByName("hudson.model.JDK");

JDK jdk = new JDK("JDK 8", "/usr/lib/jvm/java-8-openjdk-amd64");

jdkDesc.setInstallations(jdk); 

jdks = jdkDesc.getInstallations();
jdkDesc.save();

Jenkins.instance.save()

thanks!
Stijn

-- 
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/c9780c70-929e-4806-b734-28161f494c6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: build trigger condition on checkin

2016-04-29 Thread Magnanao, Hector
I’m using PTC Integrity for my SCM tool, do you have any suggestions on that ?

From: jenkinsci-users@googlegroups.com 
[mailto:jenkinsci-users@googlegroups.com] On Behalf Of Tom Moore
Sent: Thursday, April 28, 2016 10:52 AM
To: Jenkins Users 
Subject: Re: build trigger condition on checkin



On Wednesday, April 27, 2016 at 11:13:05 AM UTC-4, Hector Magnanao wrote:
Hi,

I'm using Jenkins 1.625.2 on Windows and I was wondering if there was a way to 
trigger a build only on certain file types.  Right now my build runs on every 
checkin and I'd like to narrow it to down to a few type of checkins.

thanks,

If you use a post-commit hook/script to call a jenkins build, then you can have 
the hook/script use a regex matching the file types you want to watch and only 
trigger a build if a match is found.

If you are using polling and use Subversion for your SCM, then in the  Source 
Code Management section under the Subversion Modules subsection, choose 
advanced and place a regex matching the file types you want to watch in the 
included regions box.  Or you can exclude certain files, users, commit 
messages, or revisions with specfic revision properties using the excluded 
regions box, excluded users box, excluded commit messages, or exclusion revprop 
name fields.

If you are using polling and use Git for your SCM, then using the additional 
behaviors pulldown, you can ignore commits from specific users, on specific 
paths, or with specific commit messages.   To build on polling if specific 
files/paths changed, use the "Polling ignores commits in certain paths" 
behavior (I know... not obvious) and put your regex of files to trigger the 
build in the included regions box.

--
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/1d6f81d3-2ebf-4018-bdcd-6e3da696b4fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/e8165d2e8333406e8fcf227e66e952e6%40USPHLE13US07.global.corp.sap.
For more options, visit https://groups.google.com/d/optout.


Jenkins CCJPE Tutorial Video - Source Control Management :D

2016-04-29 Thread Ken Erwin
Hi everyone :)

We just released another tutorial video for preparing for the CCJPE.  

https://www.devopslibrary.com/lessons/jenkins-scm

I know everyone here is familiar with how to use an SCM with Jenkins, but 
just thought I'd post in case it's useful for teaching your junior team 
members.

Have a great day!

Ken @ DevOpsLibrary

-- 
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/ff3a2166-7a12-4395-9316-16bf0a5a27ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Failed to connect to Github repository

2016-04-29 Thread Mark Waite
Be sure that you've used the "Credentials" link from the top of the Jenkins
UI to add a new RSA private key for your user, and that you've confirmed
separately from a git command line on that Windows machine that the
credentials allow you access to the github repository.  Use that credential
in the repository section of the job definition.

If that still doesn't work, then it may be that you are running Jenkins as
a service on Windows and are encountering a known bug in the Jenkins git
plugin.  Refer to https://issues.jenkins-ci.org/browse/JENKINS-20356 for
more information on that bug.

You could check if "running as a service" is the problem by stopping the
service you're currently running, and starting Jenkins on that machine with
"java -jar jenkins.war".  Define a job in that fresh running Jenkins, and
see if it can read from that repository.

If that bug is the problem, you could enable the JGit implementation (using
"Manage Jenkins" -> "Configure System" -> "Git" -> "Add Git") and try the
JGit implementation from your Jenkins running as a Windows service.

Thanks,
Mark Waite

On Fri, Apr 29, 2016 at 7:09 AM Prasu S  wrote:

> I'm trying to connect from Jenkins(which is on windows server) to Github
> repository(this is in cloud) . I received this error: Failed to connect to
> repository :failed to connect to  using credentials(status=403).
> Please help me resolve this issue. It's urgent.
>
>
> Thank You,
> P !!
>
> --
> 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/c45809e1-b73e-4c51-a906-b403ed89ab28%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Failed to connect to Github repository

2016-04-29 Thread Prasu S
I'm trying to connect from Jenkins(which is on windows server) to Github 
repository(this is in cloud) . I received this error: Failed to connect to 
repository :failed to connect to  using credentials(status=403). 
Please help me resolve this issue. It's urgent.


Thank You,
P !!

-- 
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/c45809e1-b73e-4c51-a906-b403ed89ab28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkinsfile to clone a remote repository

2016-04-29 Thread Antonio Muñiz
You should use https://github.com/jenkinsci/workflow-remote-loader-plugin
to load an external script.

On Thu, Apr 28, 2016 at 11:51 PM, Jeeva Chelladhurai  wrote:
> Hello All,
>
> I am planning to organize my source code in one github repository, and the
> Jenkinsfile and the configuration/topology file in a different github
> repository.. Would it be possible to clone/check out the remote repository
> using my Jenkinsfile? I tried something as show below but it does not seem
> to be working... Your help is greatly appreciated ..
>
> node ('docker') {
> stage "SCM Synch"
> checkout scm
>
> stage "Main Src"
> git url: 'https://github.com//.git'
> checkout scm
>
> stage "Next Stage"
> sh "echo yet to write"
>
> }
>
>
>
> Thanks,
> Jeeva
>
> --
> 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/46730175-e8d4-4d68-aadf-16fb3e170ea7%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Antonio Muñiz
Software Engineer
CloudBees, Inc.

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


Re: Jenkins 2.0 and the game of life

2016-04-29 Thread Daniel Beck

> On 29.04.2016, at 05:37, Sarah Baker  wrote:
> 
> It's not something I'm introducing in the build line that I enter into 
> jenkins for maven.
> I don't know how it's getting introduced.

To clarify, you did not enter the values as shown on figure 2-24 on page 34, 
where the 'Goals' text field contains the text below?

> javadoc:javadoc -o


Because that's what makes Maven work offline.

-- 
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/A29B3A8F-8AD5-4A20-A982-3E3AEC589F2F%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.