Git Plugin :: how to conditional check to pull code or not on job run

2016-09-20 Thread Pooja Shah
Hi Team, Is there any way to control "git pull" or not pull using build parameters or some conditional checks for a job. I have a job in which I want to git pull only some of the times, basically at will I want to avoid pulling ( if it was related to commit message etc I could do from advance s

Re: Error in jenkins related to s3 bucket here i would like push the war file into S3 bucket and i am getting the following error.

2016-09-20 Thread thomas . lehmann
What is the S3 command you have used? Pushing a file to S3 (as you say) is something like "aws --region $region --profile $profile s3 cp $file s3://$bucket_name/$path/$file. On Monday, September 19, 2016 at 2:12:37 PM UTC+2, shrik...@gmail.com wrote: > > Failed CodeDeploy post-build step; except

Jenkins pipeline: how to get the different paths

2016-09-20 Thread thomas . lehmann
Hi, writing a Jenkinsfile like this: node{ def WORKSPACE=pwd() } The path is initially empty. The content is stored at pwd() + "@script". So basically I could use two variables - def WORK_PATH=pwd() - def SOURCES=pwd() + "@script" However there is also a @tmp path for the project and whe

Re: Using git publisher from a Jenkinsfile pipeline?

2016-09-20 Thread Andrey Makeev
I want to share my Jenkins Pipeline setup and my solution to publish changes/tags to git repo via SSH (While Git Publish Support is under development). Please check it out f

Re: Jenkins pipeline: how to get the different paths

2016-09-20 Thread thomas . lehmann
One information is "*pwd(tmp:true)*" which provides the @tmp path. When same job runs two times in parallel the path provided by pwd(...) returns a path with additionally a number. Current path:/var/lib/jenkins/workspace/Foo@2 Temp path:/var/lib/jenkins/workspace/Foo@2@tmp *Remains*: how do I

Re: Is there any variable for total build time in pipeline plugin?

2016-09-20 Thread thomas . lehmann
Mm ... I tried that ... with a sleep of 10 seconds before. The result is 0. In opposite to the variant with using System.currentTimeMillis which works fine. On Monday, September 19, 2016 at 9:24:22 PM UTC+2, Cuong Tran wrote: > > How about: > > currentBuild.getDuration() > > > https://

Re: Is adding private key to Jenkins credential list a security breach?

2016-09-20 Thread thomas . lehmann
It's a matter how it is organized ... If administrators only (a limited number of persons) have access to the manage section in Jenkins then it's probably a first step. Also an option might be to use Vault. On Monday, September 19, 2016 at 3:57:58 AM UTC+2, John Cho wrote: > > Hi, > I am reading

Re: Is adding private key to Jenkins credential list a security breach?

2016-09-20 Thread Stephen Connolly
So when you add a private key for use to connect to agents, that private key will be in the System store. The System store maintains two scopes: SYSTEM (which is only available for "system" tasks and not available to build jobs) and GLOBAL (which is available for both "system" tasks and build jobs)

Re: Is there any variable for total build time in pipeline plugin?

2016-09-20 Thread Denis Kot
Same problem. Getting 0. 2016-09-20 12:32 GMT+02:00 : > Mm ... I tried that ... with a sleep of 10 seconds before. The > result is 0. In opposite to the variant with using System.currentTimeMillis > which works fine. > > On Monday, September 19, 2016 at 9:24:22 PM UTC+2, Cuong Tran wrote: >

Release Plugin Broken

2016-09-20 Thread Sebastian
Hello, I have a problem with the Release Plugin. We updated our jenkins to 2.7.0 LTS an have now the problem that the parameters given to a release build are ignored (e.g. ${version} parameter is not processed). There is an open bug https://issues.jenkins-ci.org/browse/JENKINS-34996 and a p

Can Jenkins builds be launched in a specific order?

2016-09-20 Thread Robert Kruck
Can Jenkins builds be launched in a specific order? We are launching Jenkins builds using a spreadsheet in which the needed parameters for each Jenkins build appear in each row of the spreadsheet. We would prefer that Jenkins builds be done in a priority order, instead all the Jenkins builds wh

Re: Is there any variable for total build time in pipeline plugin?

2016-09-20 Thread Denis Kot
Nice, but how to convert milliseconds to HH:MM:SS in groovy script, in particular in pipeline plugin? Denis Kot 2016-09-19 20:58 GMT+02:00 Baptiste Mathus : > long startTime = System.currentTimeMillis() > > // Do what you need > > long elapsedMillis = System.currentTimeMillis() - startTime; > >

The SDK directory '/root/opt/android-sdk-linux' does not exist.

2016-09-20 Thread pradeep palem
Hi All, I am trying to android build from jenkins server. I have set the* env varibles* as below in /etc/profile and created a local.properties file the workspace . export ANDROID_HOME="/root/opt/android-sdk-linux" export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH" *In local

Re: Release Plugin Broken

2016-09-20 Thread 'Björn Pedersen' via Jenkins Users
See https://jenkins.io/blog/2016/05/11/security-update/ for how to solve it temporarily(until all plugins are migrated). Am Dienstag, 20. September 2016 15:26:50 UTC+2 schrieb Sebastian: > > Hello, > > I have a problem with the Release Plugin. > > We updated our jenkins to 2.7.0 LTS an have now t

Re: The SDK directory '/root/opt/android-sdk-linux' does not exist.

2016-09-20 Thread Nico Schmoigl
Hi Pradeep, your SDK is the root's home directory, dude. Usually, the unix permissions[1] do not permit to access this directory for other users (check with ls -al /root ). I would suggest to move the SDK to some other location on your filesystem (for example as /opt). Remember to adjust the e

Re: Jenkins Integration with FreeIPA LDAP

2016-09-20 Thread Neil White
I'm running Jenkins 2.21 and I got it running on LDAP with only the following details. This is from the config.xml, which you can translate into the frontend. ipa.example.com dc=example,dc=com false cn=users,cn=accounts uid={0} cn=groups,cn=accounts memberOf=cn=jenkins,cn=groups,cn=accounts,dc=ex

Re: BlueOcean plugin now available in main update center

2016-09-20 Thread James Dumay
Hmm David that shouldn't happen at all :( Would you be able to file a bug against the "blueocean-plugin" component on https://issues.jenkins-ci.org with some more detailed info? Information that would be great to include is your Jenkins version, your auth plugin version and redacted Jenkins lo

Re: The SDK directory '/root/opt/android-sdk-linux' does not exist.

2016-09-20 Thread pradeep palem
Hi Nico , Issue was resolved ... Thanks alot for your help . Regards, Pradeep On Tuesday, September 20, 2016 at 9:55:31 PM UTC+5:30, Nico Schmoigl wrote: > > Hi Pradeep, > > your SDK is the root's home directory, dude. Usually, the unix > permissions[1] do not permit to access this directory f

Git commands succeed within a build step but fail when the plugin executes them.

2016-09-20 Thread Steve K
Hello, I'm running Jenkins 2.7.3 from a CentOS master invoking Git commands on a Windows 8.1 machine. git commands, such as the following, succeed when run within a "Windows batch command" step. *git clone --verbose --recursive --branch fs02 ssh://scmbu...@rocgit01.corp.mycompany.com:29418/C

Forcing Jenkins to use TLSv1.2 for LDAP connections

2016-09-20 Thread Joshua Schaeffer
I'm trying to setup Jenkins to connect to my OpenLDAP server for SSO, but it appears that when it tries to connect it uses TLS1.0. I currently have this disabled on my LDAP server and would like to keep it that way if possible. If I enable 1.0 then I can connect successfully. How can I tell Jen

Re: Git commands succeed within a build step but fail when the plugin executes them.

2016-09-20 Thread Mark Waite
You need to define the location of the git command on your Windows agent. Usually that is in C:\Program Files\Git\bin\git.exe. Look in the "Tool Locations" section of the agent configuration page. Mark Waite On Tue, Sep 20, 2016 at 11:04 AM Steve K wrote: > Hello, > > I'm running Jenkins 2.7.3

Re: Jenkins on Websphere 8.5 - out of memory (heap)

2016-09-20 Thread Baptiste Mathus
I must be missing something. 15 characters is not that much in memory. Let's say around 300 kilo bytes actually in the JVM memory in utf 16. So I don't get where those 11GB come from. Or do you mean 15 strings of characters of various sizes? Cheers Le 20 sept. 2016 8:51 AM, "Tomáš Mrázek

Re: Jenkins pipeline: how to get the different paths

2016-09-20 Thread Baptiste Mathus
What are you trying to do? At first sight, seems to me you're on the path of pain. You seem to be to developing things somehow in the "user" space relying on internal things that may change without any notice IMO. Just my 2 cents Le 20 sept. 2016 11:10 AM, a écrit : > One information is "*pwd(

Re: Can Jenkins builds be launched in a specific order?

2016-09-20 Thread Baptiste Mathus
I'm not sure I got how those builds are started. But if you want to sort builds according to priorities, you can look at the priority sorter plugin. It's pretty feature complete IMO: offers many different strategies and works fine from my experience. Cheers Le 20 sept. 2016 3:42 PM, "Robert Kruc

Re: Is there any variable for total build time in pipeline plugin?

2016-09-20 Thread Baptiste Mathus
We should offer high level utility DSL steps for that maybe. Also to help with whitelisting. In the meantime, simply Google for "groovy date formatting". Le 20 sept. 2016 4:18 PM, "Denis Kot" a écrit : > Nice, but how to convert milliseconds to HH:MM:SS in groovy script, in > particular in pipel

Re: Git commands succeed within a build step but fail when the plugin executes them.

2016-09-20 Thread Steve K
Thanks Mark. That does seem to have done the trick. I had added the Git location on a Global basis (via. Manage Jenkins --> Configure System) but that didn't help. I'm a little disappointed that I have to deal with this on a per-agent basis (we didn't need to do that when using a v1.625.3 Wind

Re: Git commands succeed within a build step but fail when the plugin executes them.

2016-09-20 Thread Mark Waite
If you use the Git for Windows installer, it offers 3 choices for how you can modify your PATH to include git. If you install in "Program Files" (rather than a thumbdrive install) and choose to at least be able to run git from the Windows command prompt (the middle choice), then you shouldn't need

Re: Git commands succeed within a build step but fail when the plugin executes them.

2016-09-20 Thread Steve K
Thanks Mark. That's interesting, because I did modify the agent's configuration to add the Git executable's directory to the %PATH% environment variable. Prior to that, the Git commands did not work from within a build step either. It would seem that, with Git's bin directory in the PATH, the plu

terminate pipeline parallal on first failure

2016-09-20 Thread Åsmund Østvold
hi All, Do anybody have an example or a pointer to how one could terminate a parallel pipeline section on first failure? The use case is that I have 14 tests in a checkin regression pipeline. Some tests take 2 min some take 40 min. To speed up feedback to the users we want to give feed back ASAP

Re: terminate pipeline parallal on first failure

2016-09-20 Thread Baptiste Mathus
Hi, stage('tests') { parallel 'longTests': { build job: 'testjob1', quietPeriod: 0 }, 'shortTests':{ // this will fail 1 sec build job: 'testjob2', quietPeriod: 0 }, failFast: true } Cheers 2016-09-20 22:43 GMT+02:00 Åsmund Østvol

Re: terminate pipeline parallal on first failure

2016-09-20 Thread Åsmund Østvold
Thank you Baptiste! Tested and it worked. You owe you a beer! I am new to pipeline programming. I worked several hours today on this and other pipeline related work. Could you please point me to the documentation of this syntax? I must have been looking in the wrong location. Cheers On Tue, S

Re: Is adding private key to Jenkins credential list a security breach?

2016-09-20 Thread Michael Lasevich
You got it backwards, master connects to Slave using standard SSH Pub/Private key auth. So, since the master is connecting to slave, you are not putting Slave's private keys on Master, you are putting Master's public key on Slave. While this looks like same thing physically, logically it explai

Re: Jenkins Integration with FreeIPA LDAP

2016-09-20 Thread Michael Lasevich
Out of curiosity, have you gotten the groups to work in this config? I have this same setup working, but I can only see groups IFF the user already has admin rights (which is very backwards and useless, as groups are mostly meaningless if you are already admin). I opened a bug with LDAP plugin

Re: Server ssh errors on pipeline jobs

2016-09-20 Thread gary . hooper
I am seeing the exact same problem. It just started happening out of the blue, no known changes to Jenkins or builder node (which is a Mac). Ion, did you resolve it? --gary On Wednesday, June 29, 2016 at 12:48:36 PM UTC-7, Ion Roșca wrote: > > Hi All, > > I managed to implement the build infra

Re: Server ssh errors on pipeline jobs

2016-09-20 Thread Mark Waite
Did your Jenkins server recently upgrade to git plugin 3.0.0? There has been at least one report of authentication issues on a Mac running git plugin 3.0.0. If so, then you might check if a revert of the upgrade to git plugin 3.0.0 resolves the issue. Mark Waite On Tue, Sep 20, 2016 at 5:29 PM

Re: Server ssh errors on pipeline jobs

2016-09-20 Thread Gary Hooper
It's happening with both 3.0.0 and 2.4.4. (We just upgraded to 3.0.0 to see if that would help; alas, it did not.) --gary On 9/20/16 17:29, Mark Waite wrote: Did your Jenkins server recently upgrade to git plugin 3.0.0? There has been at least one report of authentication issues on a Mac run

Re: Server ssh errors on pipeline jobs

2016-09-20 Thread Mark Waite
Some of the possible investigations to perform: - If the URL you're using is an ssh style or an scp style URL, then you need to check that your private key authentication from the Jenkins agent to the git server are functioning - If using ssh, you might try the instructions at http

Cloning private Git repo (2FA enabled) is timing out on Windows 10 Pro

2016-09-20 Thread wilson luu
I've been stuck on this problem for a couple of days and I cannot find any resolution to this problem. Some of my colleagues suggest I use SSH to clone my private repo, but I want to make sure I didn't miss something with this setup. Hopefully, someone has encountered this issue before and was

Re: Cloning private Git repo (2FA enabled) is timing out on Windows 10 Pro

2016-09-20 Thread Mark Waite
I've never tested the git plugin with wincred, so I don't know if it will work. If it does not work, you may need to remove your stored credentials http://stackoverflow.com/questions/15381198/remove-credentials-from-git and rely on the credentials mechanism inside Jenkins. When you say that you e

Re: terminate pipeline parallal on first failure

2016-09-20 Thread Cuong Tran
The reference link is right on any pipeline job. You should see a "Pipeline Syntax" link, click on that will give a list of known steps, the click on the question icon will give you an example. On Tuesday, September 20, 2016 at 1:57:43 PM UTC-7, asmundo wrote: > > Thank you Baptiste! > > Teste

Re: Maintaining a unique Build Number across multiple build servers

2016-09-20 Thread Cuong Tran
It doesn't exist. On Monday, September 19, 2016 at 12:54:15 PM UTC-7, Robert Kruck wrote: > > Is it possible to preserve the integrity of build numbers (NO DUPLICATES > and build numbers in order) while building in multiple Jenkins build > servers? > > If this capability exists in Jenkins, what

Re: Cloning private Git repo (2FA enabled) is timing out on Windows 10 Pro

2016-09-20 Thread Baptiste Mathus
+1. It's actually more than recommended, it's compulsory. With HTTPS on GitHub in that situation, you must use an access token. Using your classical credentials won't work. See https://help.github.com/articles/which-remote-url-should-i-use/#when-2fa-is-enabled (and the link mark already provided in

Re: Cloning private Git repo (2FA enabled) is timing out on Windows 10 Pro

2016-09-20 Thread wilson luu
Yes, when I say my 2FA token, I meant my personal access token. I also tried the Jenkins Credentials first before setting *git config --global credential.helper wincred.* On Tue, Sep 20, 2016 at 9:43 PM Baptiste Mathus wrote: > +1. It's actually more than recommended, it's compulsory. > With HTT

Re: terminate pipeline parallal on first failure

2016-09-20 Thread Michael Neale
There is also: https://jenkins.io/doc/pipeline/ but generally for the steps - if you open a job to edit, you should see either near the pipeline text area or on the left a "Pipeline Syntax" link you can open in a new tab. It gives you a choice of steps that will build the syntax out for you as

Re: Maintaining a unique Build Number across multiple build servers

2016-09-20 Thread Michael Neale
Not sure if it may help solve a similar aim - but https://wiki.jenkins-ci.org/display/JENKINS/Version+Number+Plugin exists (might be others) On Wednesday, September 21, 2016 at 1:47:03 PM UTC+10, Cuong Tran wrote: > > It doesn't exist. > > On Monday, September 19, 2016 at 12:54:15 PM UTC-7, Robe