Re: Groovy save project does not always work

2016-04-13 Thread Sverre Moe
Making a change in Script console using Groovy and then envoke 
project.save(), why is it that when I try to read the value again it does 
not show the changed value, but the old one.

For instance given this groovy script to add some environment variables.
#!/usr/bin/env groovy

import java.lang.StringBuilder
import hudson.matrix.MatrixProject
import org.jenkinsci.plugins.envinject.EnvInjectJobProperty
import org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo

def jenkinsInstance = jenkins.model.Jenkins.getInstance()
def developmentView = jenkinsInstance.getView("myView")
developmentView.getItems().each { project ->

StringBuilder builder = new StringBuilder()
builder.append("NO_CPPCHECK=true")
builder.append("\n")
builder.append("NO_INSTALL=true")
final def propertiesContent = builder.toString()

def info = new EnvInjectJobPropertyInfo(null, propertiesContent, null, 
null, null, false)
def property = new EnvInjectJobProperty()
property.setOn(true)
property.setKeepJenkinsSystemVariables(true)
property.setKeepBuildVariables(true)
property.setInfo(info)

project.addProperty(property)
project.save()
}

Trying to read the same environment variables
#!/usr/bin/env groovy

import org.jenkinsci.plugins.envinject.EnvInjectJobProperty
import org.jenkinsci.plugins.envinject.EnvInjectJobPropertyInfo

def jenkinsInstance = jenkins.model.Jenkins.getInstance()
def developmentView = jenkinsInstance.getView("myView")
developmentView.getItems().each { project ->
  def EnvInjectJobProperty property = 
project.getProperty(EnvInjectJobProperty.class)
  if (property != null) {
def info = property.getInfo()
println info.getPropertiesContent()
  }
}

Not all projects now shows the environment variables.

onsdag 13. april 2016 09.47.23 UTC+2 skrev Sverre Moe følgende:
>
> I am not sure what I am doing wrong with my groovy script.
> I have written a groovy update script to bulk update all my projects.
> Sometimes it does not take affect when I call project.save()
> I can open that project configuration page and everything looks right. The 
> updated content is there.
> However when I write a groovy read script to print out that information I 
> updated, not all projects show the updated information.
> If I then open those projects configuration page, do nothing and just 
> press save then that information is available when I run the read script 
> again.
>
> Do I need to perform some other action than just project.save()
>

-- 
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/c87d1759-966c-4d90-89cf-361784b240fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I write job script and load it to jenkins to work ?

2016-04-13 Thread Richard Bywater
There's also Jenkins Job Builder -
http://docs.openstack.org/infra/jenkins-job-builder/ - which isn't a plugin
to Jenkins but creates and uploads Jenkins config.xml based off of YAML.

Richard.

On Thu, 14 Apr 2016 at 13:59 Slide  wrote:

> There are two options that you might be interested in:
>
> 1) Job DSL plugin -
> https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
> 2) Pipeline Plugin -
> https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin
>
> Both use a groovy DSL to either generate jobs or run pipelined tasks.
>
> On Wed, Apr 13, 2016 at 6:55 PM Andy Billy  wrote:
>
>> hi:)
>>
>>For the more and more jobs needed to be configured ,Is there a better
>> way to configure them other than operating the ui workflow ?
>>if I can write job config script and load it to jenkins ,that is
>> pretty light work。
>> 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/2e60b9ae-ba5c-4feb-86e0-242e48ace19a%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/CAPiUgVco8VrTjhAvscf0z5jp5QWq6B9Vv4J5%2Bjp20COk0YDY2A%40mail.gmail.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/CAMui946Zmnos_R_4NcKTAPtDVZGXBSywf-gYXRthp2OP8T24kQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I write job script and load it to jenkins to work ?

2016-04-13 Thread Slide
There are two options that you might be interested in:

1) Job DSL plugin -
https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin
2) Pipeline Plugin -
https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Plugin

Both use a groovy DSL to either generate jobs or run pipelined tasks.

On Wed, Apr 13, 2016 at 6:55 PM Andy Billy  wrote:

> hi:)
>
>For the more and more jobs needed to be configured ,Is there a better
> way to configure them other than operating the ui workflow ?
>if I can write job config script and load it to jenkins ,that is pretty
> light work。
> 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/2e60b9ae-ba5c-4feb-86e0-242e48ace19a%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/CAPiUgVco8VrTjhAvscf0z5jp5QWq6B9Vv4J5%2Bjp20COk0YDY2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How can I write job script and load it to jenkins to work ?

2016-04-13 Thread Andy Billy
hi:)

   For the more and more jobs needed to be configured ,Is there a better 
way to configure them other than operating the ui workflow ?
   if I can write job config script and load it to jenkins ,that is pretty 
light work。
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/2e60b9ae-ba5c-4feb-86e0-242e48ace19a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Script works in bash terminal but not in Shell build step in a Jenkins job

2016-04-13 Thread morty
I am running Jenkins on Ubuntu 15.10. I have the following bash script:

#!/bin/bash
STAGING_DIR="staging"

rm -Rf $STAGING_DIR
mkdir $STAGING_DIR
cd $STAGING_DIR

git clone [path-to-my-git-repo] .

virtualenv --no-site-packages virtual_django
source virtual_django/bin/activate
pip install django

python manage.py runserver 0.0.0.0:8000

When I run the above script in a shell build step the build just hangs with 
this in the build log:

Cloning into '.'...

New python executable in virtual_django/bin/python2

Also creating executable in virtual_django/bin/python

Installing setuptools, pip...done.

Running virtualenv with interpreter /usr/bin/python2

Downloading/unpacking django

Installing collected packages: django

Successfully installed django

Cleaning up...


When I run the same script from a terminal on the Ubuntu machine (under the 
jenkins user) it works fine and outputs:


Installing setuptools, pip...done.
Downloading/unpacking django
  Downloading Django-1.9.5-py2.py3-none-any.whl (6.6MB): 6.6MB downloaded
Installing collected packages: django
Successfully installed django
Cleaning up...
Performing system checks...

System check identified no issues (0 silenced).

You have unapplied migrations; your app may not work properly until they 
are applied.
Run 'python manage.py migrate' to apply them.

April 13, 2016 - 19:55:17
Django version 1.9.5, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.




Any ideas why the above script hangs in the Jenkins job but works fine from 
the terminal?

-- 
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/dddb2f10-356d-4547-ac4a-9d704da10880%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


S3 Notifications using Jenkins

2016-04-13 Thread alwaysonnet
Hi,

Is there anyway that I can configure S3 notifications for AWS Lambda using 
Jenkins?

Any help is appreciated.

Thanks,
Kalyan

-- 
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/15cba183-717e-4d5f-a9ff-a85d022f64c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Webpage for Git Client Plugin is empty

2016-04-13 Thread Mark Waite
Thanks!

On Wed, Apr 13, 2016 at 11:03 AM Daniel Beck  wrote:

>
> On 13.04.2016, at 18:30, Daniel Beck  wrote:
>
> > Cache weirdness, I think:
> > https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin?foo
> >
> > Not sure how to fix though, I'll ask Tyler.
>
> It's fixed now.
>
> --
> 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/70928021-625F-4C4F-9839-B942E080EDF7%40beckweb.net
> .
> 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/CAO49JtGoB8q5JQggZTxOEx48VTvm14-356-UTJoLk7zd56hy5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Credentials for Each User

2016-04-13 Thread Stephen Connolly
It depends on how the plugin has been written. If it is written correctly,
then it should allow the user to select their own credentials if they have
the appropriate permissions (I cannot recall, but you may have to enable a
permission by system property... Or it could be a bug in the gitlab plugin)

On Wednesday 13 April 2016, ayesha s  wrote:

> Hi Stephen,
>
> Thanks for your response!
>
> The main problem is that the *per-user credential* is *not getting
> populated in the drop down* under the project configuration window(see
> attchment). Hence the user is unable to use that credential to connect to
> GitLab repo.🙁
>
> Also could you please elaborate more on Step 2 you mentioned - configure
> the jobs to run as the user
> Is it something related to this-Refer3rd  attachment
>
>
> Do you think that instead of SSH credential, using *https credential *in
> jenkins will solve this issue?Though no information is available online
> on how to connect to GitLab using https credentials method. 🤔
>
>
>
> Regards
>
> Ayesha Siddiqui
>
> On Mon, Apr 11, 2016 at 7:37 PM, Stephen Connolly <
> stephen.alan.conno...@gmail.com
> > wrote:
>
>> Step 1: Install the Authorize Project plugin
>> Step 2: configure the jobs to run as the user
>> Step 3: have the user put their credentials in their per-user credentials
>> store
>> Step 4: don't put credentials in the Jenkins System credentials store
>> Step 5: Sit back, light your pipe and enjoy the satisfaction of a job
>> well done
>>
>> On 11 April 2016 at 08:32, ayesha s > > wrote:
>>
>>> Hi all,
>>>
>>> Currently I have a global credential created(ssh keys) to build a
>>> project in GitLab.And any other(authenticated) user that logs into this
>>> Jenkins instance on windows server are able to use the same credential to
>>> build their projects in GitLab Repository.A Non-Admin user can see another
>>> user`s user Jenkins credentials' contents (private keys, etc!)
>>> But for security reasons this should not happen.Each user should only be
>>> able to build his/her GitLab repo using his/her credential(ssh keys).So he
>>> should also not  be able to view any other credentials apart from the one
>>> created by/for him.
>>> I am using Roles Based Authorization plugin to give different users
>>> different roles for different projects.If I want to create a project based
>>> credential at the user level(and not global credential) then that
>>> credential does not appear in the drop down under Project
>>> configuration(Refer to 5.jpeg).And I believe that if we could see the
>>> credential here in drop down then it would have solved my purpose.Or is
>>> there any other way so that every user can only view/use  his/her own
>>> credentials and not any other user credentials?
>>>
>>> I have attached screen shots for better understanding of my current
>>> problem and the solution I am looking for.
>>> 1.jpeg-> Global credentials  view from admin login (all users that log
>>> in are able see and use this)
>>> 2.jpeg->Global credentials  view from normal user login
>>> 3.jpeg->Credential created under the current user(but its not visible in
>>> the 5.jpeg drop down for it to be used to build GitLab Repo)
>>> 4.jpeg->Global credential being used to build GitLab project(Every user
>>> using ayesha_siddi...@in.ibm.com
>>> 
>>> credentials- which is not correct)
>>> 5.jpeg->Drop down only shows Global credentials and not credentials
>>> created under a user Credentials(prpan...@in.ibm.com
>>>  as created in
>>> 3.jpeg not visible here)
>>> Roles & Permissions.jpeg ->Credentials permission given thru Role Based
>>> Authorization Plugin
>>>
>>>
>>> Till now I have tried creating 'domains' and created  credentials for
>>> that domain  but that does not solve the purpose.I have also referred to
>>> following discussions:
>>>
>>> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/jenkinsci-users/user$20credentials|sort:relevance/jenkinsci-users/MMvgsv8J3hE/Q4MpfhXjBAAJ
>>>
>>>
>>> The following discussion is similar to the requirement I am looking
>>> for.But even after installing 'Authorization Plugin' its still not clear
>>> what other settings needs to be done.As this still is not letting one see
>>> per-user credentials in the drop down to select in project configuration.
>>>
>>>
>>> https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!searchin/jenkinsci-users/user$20credentials|sort:relevance/jenkinsci-users/t9z2uLuvf74/ZLJwxEHrCgAJ
>>>
>>>
>>> Kindly let me know once I have installed Authorization plugin what next
>>> needs to be done to solve the problem I am facing?Or if there is other
>>> method to achieve my purpose?
>>>
>>> --
>>> 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

Re: Jenkins 2.x: Multibranch Pipeline - Dynamic Jenkinsfile

2016-04-13 Thread Patrick Wolf
Hi, Malte.

The "Jenkinsfile" is the marker file that Jenkins uses to find what
branches and PRs to build in a multibranch job. The Jenkinsfile tells
Jenkins 2 things: 1. I want to build this branch or PR. 2. The actual Job
to run.  Without a Jenkinsfile, Jenkins assumes that the branch needs to be
skipped.

The Jenkinsfile does need to be present but you have a lot flexibility
regarding what it contains. Using a Jenkinsfile there are ways to use an
alternative repository that defines the pipeline to run in various ways:

- The Remote Loader Plugin (
https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Remote+Loader+Plugin).
Using this plugin you can store your Pipeline script in any repository and
load it from your Jenkinsfile. The Jenkinsfile can be empty except for this
remote load. This will run the script for any branch that contains this
Jenkinsfile.

- The Global Library included in Jenkins with Pipeline. (
https://www.cloudbees.com/blog/jenkins-workflow-using-global-library-implement-re-usable-function-call-secured-http-endpoint).
With the global library you can create as many reusable Pipeline scripts as
you like. The name of the function becomes a global variable available
within any Pipeline script in Jenkins (including in Jenkinsfiles).  That
means you can create a method that has parameters or not and then simply
call that method from the Jenkinsfile.

You can use a combination of these two as well. So, yes, the Jenkinsfile
needs to be present but it doesn't have to contain your Pipeline script. It
can simply tell Jenkins where to find the Pipeline script that you want to
run.

This is a really brief answer but hopefully can get you on the right track.

Regards,
Patrick

On Wed, Apr 13, 2016 at 5:43 AM,  wrote:

> Hello,
>
> I have a question related to the new Pipeline Multi-branch Project:
>
> I have a lot of small repositories which share the same setup. Currently I
> use the JobDSL to automatically create new Jobs in Jenkins.
> In the future I would like to use the Multi Branch Pipeline project. I
> would use a JobDSL seed job to create a Multibranch Pipeline Project for
> each of my repositories (>#100, which all share the same setup!).
> But, since all should share the same setup, I do not want to store a
> _Jenkinsfile_ in each of the repositories. The Jenkinsfile should be used
> from a single source (e.g. another repository).
>
> My question: Can I use another source for the Jenkinsfile in a Pipeline
> Multi Branch Project than the Jenkinsfile in the repository itself?
> In a "normal" Pipeline project one can use a other source for the
> Jenkinsfile.
>
> Do I miss something or is it a missing feature?
>
> Thanks.
> Malte
>
> --
> 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/72d7249f-003c-43d5-afd6-4edef62defa1%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrick Wolf
Sr. Product Manager
CloudBees

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


Re: Webpage for Git Client Plugin is empty

2016-04-13 Thread Daniel Beck

On 13.04.2016, at 18:30, Daniel Beck  wrote:

> Cache weirdness, I think:
> https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin?foo
> 
> Not sure how to fix though, I'll ask Tyler.

It's fixed now.

-- 
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/70928021-625F-4C4F-9839-B942E080EDF7%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Webpage for Git Client Plugin is empty

2016-04-13 Thread Daniel Beck

On 13.04.2016, at 17:42, Mark Waite  wrote:

> It appears that the git client plugin wiki page has been superseded by a new 
> page from Steve Cohen.  The history of 
> https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin shows only one 
> version, rather than the many versions which should exist for that .
> 
> Is there a way to delete or revert that change?
> 

Cache weirdness, I think:
https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin?foo

Not sure how to fix though, I'll ask Tyler.

-- 
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/DA1F2751-F4E0-46AA-A083-A7E689259BD0%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Providing web link to downstream job before it completes?

2016-04-13 Thread Andrew Geissler
When calling another job from within a jenkins job, you get this type of 
output in the console:

Run condition [Or] enabling perform for step [Trigger/call builds on other 
> projects]
> Waiting for the completion of 


The link provided takes you to the other project, but not the specific job 
within that project you spawned.  When running a lot of jobs in that other 
project, it can actually be a pain to find your actual job.


Is there an easy way to link directly to the other projects job from the main 
one?  I know you get the full link after the sub-job has completed but a lot of 
times you want to look at it as it's executing.


Thanks,

Andrew

-- 
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/604fe1d3-e096-4494-b1b2-8cf333b134d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Fwd: Webpage for Git Client Plugin is empty

2016-04-13 Thread Mark Waite
It appears that the git client plugin wiki page has been superseded by a
new page from Steve Cohen.  The history of
https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin shows only
one version, rather than the many versions which should exist for that .

Is there a way to delete or revert that change?

Thanks,
Mark Waite

-- Forwarded message -
From: chris.and.amy.shan...@gmail.com (JIRA) 
Date: Wed, Apr 13, 2016 at 8:27 AM
Subject: [JIRA] [git-client-plugin] (JENKINS-34203) Webpage for Git Client
Plugin is empty
To: 


Christopher Shannon

*created* an issue

Jenkins  /
 JENKINS-34203

Webpage for Git Client Plugin is empty

Issue Type: Bug
Assignee: Mark Waite

Components: git-client-plugin
Created: 2016/Apr/13 2:26 PM
Priority: Minor
Reporter: Christopher Shannon


The following page is empty and does not provide links to download the
plugin.

https://wiki.jenkins-ci.org/display/JENKINS/Git+Client+Plugin
 Add Comment


This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)

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


Plugin for multi-branch jobs?

2016-04-13 Thread David Aldrich
Hi

I am using Matthew DeTullio's Multi-Branch Project Plugin.  I have a few issues 
with it and so am wondering if there is an alternative.

I have seen a reference to 'multibranch pipeline builds' in another thread.  
Would that be an alternative to consider?

(I know nothing about pipeline builds).

Best regards

David

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


Re: jenkins home directory

2016-04-13 Thread Gurusharan
Thanks for the info Hector.

Glad that it worked.


Bye for now,
*Gurusharan S.*

On Wed, Apr 6, 2016 at 10:35 PM, Hector Magnanao 
wrote:

> Hello Gurushan,
>
> These steps worked great !!! One thing that I noticed that restarting
> Jenkins didn't update the JENKINS_HOME variable for me.  I had to actually
> reboot the machine.  After that, I went into Manage Jenkins console and I
> saw the variable change.
>
> Thanks,
> Hector
>
> On Tuesday, March 1, 2016 at 7:51:50 PM UTC-6, Gurusharan S wrote:
>
>> Hello Hector,
>>
>> I see now what's the problem. I believe the environment variables may not
>> be taken by the service, it uses jenkins.xml to get the environment
>> variables. By default, a windows service uses the jenkins directory you
>> give for installation as the jenkins home.
>>
>> Can you please check if the steps in this link help you?
>> http://tech.nitoyon.com/en/blog/2014/02/25/jenkins-home-win/
>>
>> Please note that you MUST not move some of the files from the old jenkins
>> directory and that you need that directory to stay there (I mean you should
>> not be deleting the whole directory).
>>
>> Bye for now,
>> *Gurusharan S.*
>>
>> On Mon, Feb 29, 2016 at 9:09 PM, Hector Magnanao 
>> wrote:
>>
>>> Hi Gurusharan,
>>>
>>> Yes, I followed the exact steps that Geoffroy outlined above:
>>>
>>>1. shutdown your jenkins instance
>>>2. move the folder /path/to/old_jenkins_home to the new location
>>>/path/to/new_jenkins_home
>>>3. create an environment variable JENKINS_HOME, which value is
>>>/path/to/new_jenkins_home
>>>4. start your jenkins instance
>>>
>>> I am currently running Jenkins as a windows service.  I noticed that if
>>> I run the jenkins service from the command line and go into Jenkins, the
>>> new home directory is reflected.  But when run it as a windows service, the
>>> old home directory is still showing.  How would I do that so my new home
>>> directory is reflected from the windows service ?
>>>
>>> Hector
>>>
>>> On Friday, February 26, 2016 at 9:36:51 PM UTC-6, Gurusharan S wrote:
>>>
 Hi Hector,

 Did you try the steps Geoffroy had explained?

 If so can you please brief us on how you are running Jenkins (windows
 service, init.d on linux, etc.) and how you followed those steps.

 The steps are generic, how ever depending on how you run Jenkins,
 setting up the environment might be tricky and so, the more information you
 can provide the better it is to help troubleshoot.

 Regards,
 Gurusharan S.
 On Feb 27, 2016 3:16 AM, "Hector Magnanao"  wrote:

> I followed the steps above but when I verified, the old home directory
> is still showing up.  How do I change the home directory for my login in
> Jenkins to the new Jenkins home ?
>
> On Sunday, February 21, 2016 at 10:01:35 AM UTC-6, Gurusharan S wrote:
>>
>> Hi Hector,
>>
>> On how to verify the new home directory, you need to go to the
>> Configure jenkins page: Manage Jenkins -> Configure System.
>>
>> Typically the jenkins home directory of the current instance will be
>> displayed first in the form.
>>
>> Hope this helps,
>>
>> Bye for now,
>> Gurusharan S.
>>
>>
>> On Friday, 19 February 2016 21:21:59 UTC+5:30, Hector Magnanao wrote:
>>>
>>> How do I change the home directory for Jenkins without having to
>>> reinstall ? And how do I verify the new home directory once it's 
>>> changed ?
>>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/eXEvmIA9sYk/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/e15caf38-d4bb-4a93-848b-8d8a0f0b3a59%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Jenkins Users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/jenkinsci-users/eXEvmIA9sYk/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/6ee60ffb-af67-4a5f-aae3-74ff4108dead%40googlegroups.com
>>> 
>>> .
>>>
>>> For more options, visit https:

Jenkins 2.x: Multibranch Pipeline - Dynamic Jenkinsfile

2016-04-13 Thread maltejacobi
Hello, 

I have a question related to the new Pipeline Multi-branch Project:

I have a lot of small repositories which share the same setup. Currently I 
use the JobDSL to automatically create new Jobs in Jenkins.
In the future I would like to use the Multi Branch Pipeline project. I 
would use a JobDSL seed job to create a Multibranch Pipeline Project for 
each of my repositories (>#100, which all share the same setup!). 
But, since all should share the same setup, I do not want to store a 
_Jenkinsfile_ in each of the repositories. The Jenkinsfile should be used 
from a single source (e.g. another repository).

My question: Can I use another source for the Jenkinsfile in a Pipeline 
Multi Branch Project than the Jenkinsfile in the repository itself?
In a "normal" Pipeline project one can use a other source for the 
Jenkinsfile.

Do I miss something or is it a missing feature?

Thanks.
Malte

-- 
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/72d7249f-003c-43d5-afd6-4edef62defa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins 2.x - DSL - error handling?

2016-04-13 Thread thomas . lehmann
See my answer 
here: https://groups.google.com/forum/#!topic/jenkinsci-users/QN7ClRVj1fQ

On Wednesday, April 13, 2016 at 10:43:04 AM UTC+2, thomas@teamaol.com 
wrote:
>
> Assume a pipeline where one stage "Provide Database" runs a Docker 
> container providing a database.
> Assume we have some tests in a next stage "Run Tests".
> Assume the tests fails.
>
> *How do I cleanup the running Docker container when the*
> *next stage "Cleanup Database" is not called*?
>
> Kind Regards,
> Thomas
>

-- 
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/c2aef460-d012-4c3f-9677-9462b51068d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How can I react to a build failure in pipeline?

2016-04-13 Thread thomas . lehmann
Hi,

It took me a while to find it but it looks like this is the approach
which is also documented ...

... you can find the relating documentation when you use the "*Snippet 
Generator*"
looking for the entry "*catchError*" and then clicking one the question 
mark.

The final implementation of course depends on your needs. If you wanna stop
the pipeline but doing the cleanup then next example is probably one way to 
go.
But you also could do a kind of cleanup and proceed with next stage when 
this
is possible in your case.

A bit unfortune - I say - that such things are not documented 
here: https://jenkins.io/doc/pipeline/

Regards,
Thomas

node {
try {
stage "One"
sh "rm /tmp/file_does_not_exist"
} catch (all) {
// doing some cleanup for stage one
throw new Exception("Stage One failed!")
} 

try {
stage "Two"
echo "hello world!"
} catch (all) {
// doing some cleanup for stage two
throw new Exception("Stage Two failed!")
} 
}




On Wednesday, April 13, 2016 at 12:25:44 AM UTC+2, Scott Richmond wrote:
>
> I need to be able to do a HTTP POST when the Jenkins Pipeline job finishes 
> in failure due to some issue in the process of doing its tasks. Basically I 
> need to surround the pipeline in a giant try-catch{}. Does pipeline provide 
> functionality to perform final tasks in the event of a failure?
>

-- 
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/7c2528d6-e13a-4408-919c-0a884b9ea258%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Keyboard navigation on New item

2016-04-13 Thread Manuel Jesús Recena Soto
Hello,

Few days ago, I sent a PR [1] in order to provide keyboard navigation
on New item page.

With the goal of making easier its review I've attached (to Jira issue
and to the PR description) a screencast with the result.

Please, find the screencast in this link:
https://goo.gl/xNpn3D

Regards,

[1] https://github.com/jenkinsci/jenkins/pull/2250

-- 
Manuel Recena Soto
* manuelrecena.com [/blog]
* linkedin.com/in/recena

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


Re: I don't understand why one of my jobs starts another

2016-04-13 Thread Erik Vande Velde
The config.xml of the upstream job is attached, there is no obvious 
reference to the other job ...

On Wednesday, April 13, 2016 at 12:40:50 PM UTC+2, Daniel Beck wrote:
>
>
> On 13.04.2016, at 09:39, Erik Vande Velde  > wrote: 
>
> >  How can i find out WHY jenkins thins that trunk_util wants to start 
> 2.0_toolbox ? 
>
> Look at and/or provide the configuration of the job that does something 
> you don't expect it to. 
>
>

-- 
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/dacb54d2-444d-4207-97c8-c987d75a3786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


config.xml
Description: XML document


Re: I don't understand why one of my jobs starts another

2016-04-13 Thread Daniel Beck

On 13.04.2016, at 09:39, Erik Vande Velde  wrote:

>  How can i find out WHY jenkins thins that trunk_util wants to start 
> 2.0_toolbox ?

Look at and/or provide the configuration of the job that does something you 
don't expect it to.

-- 
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/A9D53C56-E558-4909-8819-C0317AAE5AF3%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: Command not found in Execute Shell build step

2016-04-13 Thread morty
Thanks that fixed the problem.

On Wednesday, April 13, 2016 at 11:25:29 AM UTC+2, thomas@teamaol.com 
wrote:
>
> Have you tried this? => 
> http://stackoverflow.com/questions/670191/getting-a-source-not-found-error-when-using-source-in-a-bash-script
> Put it as first line  "#!/bin/bash"
>
>
> On Wednesday, April 13, 2016 at 10:17:56 AM UTC+2, morty wrote:
>>
>> I have installed Jenkins on Ubuntu 15.10. In a Jenkins job I have a 
>> single Execute Shell step with:
>>
>> virtualenv --no-site-packages virtual_django
>> cd virtual_django/bin
>> pwd
>> dir
>> source activate
>>
>> When I run the job I get:
>>
>>
>> + virtualenv --no-site-packages virtual_djangoNew python executable in 
>> virtual_django/bin/python2Also creating executable in 
>> virtual_django/bin/pythonInstalling setuptools, pip...done.Running 
>> virtualenv with interpreter /usr/bin/python2+ cd virtual_django/bin+ 
>> pwd/var/lib/jenkins/workspace/django-demo/virtual_django/bin+ dir
>> activate  activate.fish easy_install  pip   pip2.7  python2
>> activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7+ 
>> source activate*/tmp/hudson4515625893361069094.sh: 9: 
>> /tmp/hudson4515625893361069094.sh: source: not** found*Build step 'Execute 
>> shell' marked build as failure
>>
>>
>>
>>
>> So in the Jenkins job the *source* command is not found. It works fine 
>> from a terminal where I have logged in as the jenkins user. 
>>
>> Why can't the above script find the *source* command when run inside the 
>> Jenkins job?
>>
>

-- 
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/742a6aff-f199-4a16-a1f6-51da589a003c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Command not found in Execute Shell build step

2016-04-13 Thread thomas . lehmann
Have you tried this? 
=> 
http://stackoverflow.com/questions/670191/getting-a-source-not-found-error-when-using-source-in-a-bash-script
Put it as first line  "#!/bin/bash"


On Wednesday, April 13, 2016 at 10:17:56 AM UTC+2, morty wrote:
>
> I have installed Jenkins on Ubuntu 15.10. In a Jenkins job I have a single 
> Execute Shell step with:
>
> virtualenv --no-site-packages virtual_django
> cd virtual_django/bin
> pwd
> dir
> source activate
>
> When I run the job I get:
>
>
> + virtualenv --no-site-packages virtual_djangoNew python executable in 
> virtual_django/bin/python2Also creating executable in 
> virtual_django/bin/pythonInstalling setuptools, pip...done.Running virtualenv 
> with interpreter /usr/bin/python2+ cd virtual_django/bin+ 
> pwd/var/lib/jenkins/workspace/django-demo/virtual_django/bin+ dir
> activate  activate.fish easy_install  pip   pip2.7  python2
> activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7+ 
> source activate*/tmp/hudson4515625893361069094.sh: 9: 
> /tmp/hudson4515625893361069094.sh: source: not** found*Build step 'Execute 
> shell' marked build as failure
>
>
>
>
> So in the Jenkins job the *source* command is not found. It works fine 
> from a terminal where I have logged in as the jenkins user. 
>
> Why can't the above script find the *source* command when run inside the 
> Jenkins job?
>

-- 
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/1ac3ac17-7e1a-483f-85eb-f4ed383e6b1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins 2.x - DSL - error handling?

2016-04-13 Thread thomas . lehmann
Assume a pipeline where one stage "Provide Database" runs a Docker 
container providing a database.
Assume we have some tests in a next stage "Run Tests".
Assume the tests fails.

*How do I cleanup the running Docker container when the*
*next stage "Cleanup Database" is not called*?

Kind Regards,
Thomas

-- 
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/d6964f2b-38bd-4b61-9bc3-f2e5b2a8445c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I want to run jobs in between build events

2016-04-13 Thread myke
Looking for ideas...

I have build events which do not have a fixed time between events
I have downstream jobs running tests after each build.
Thereafter my environment is doing nothing until the next build event 
(could be multiple days)
I want my test environment to make use of the quiet periods

Following the downstream test job I would like to run another job. 
It would be great if this new job could be terminated in some way so as not 
to interfere with the next build job when it happens

I have looked at plugin's but cant find a good fit.
I would appreciate any ideas out there please
Myke

-- 
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/40dfa4c8-d015-4f44-9fbd-661aeda7c88d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Command not found in Execute Shell build step

2016-04-13 Thread morty
I have installed Jenkins on Ubuntu 15.10. In a Jenkins job I have a single 
Execute Shell step with:

virtualenv --no-site-packages virtual_django
cd virtual_django/bin
pwd
dir
source activate

When I run the job I get:


+ virtualenv --no-site-packages virtual_djangoNew python executable in 
virtual_django/bin/python2Also creating executable in 
virtual_django/bin/pythonInstalling setuptools, pip...done.Running virtualenv 
with interpreter /usr/bin/python2+ cd virtual_django/bin+ 
pwd/var/lib/jenkins/workspace/django-demo/virtual_django/bin+ dir
activate  activate.fish easy_install  pip   pip2.7  python2
activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7+ 
source activate*/tmp/hudson4515625893361069094.sh: 9: 
/tmp/hudson4515625893361069094.sh: source: not** found*Build step 'Execute 
shell' marked build as failure




So in the Jenkins job the *source* command is not found. It works fine from 
a terminal where I have logged in as the jenkins user. 

Why can't the above script find the *source* command when run inside the 
Jenkins job?

-- 
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/7eb1290e-0bb5-410d-b529-45d859ccf540%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Groovy save project does not always work

2016-04-13 Thread Sverre Moe
I am not sure what I am doing wrong with my groovy script.
I have written a groovy update script to bulk update all my projects.
Sometimes it does not take affect when I call project.save()
I can open that project configuration page and everything looks right. The 
updated content is there.
However when I write a groovy read script to print out that information I 
updated, not all projects show the updated information.
If I then open those projects configuration page, do nothing and just press 
save then that information is available when I run the read script again.

Do I need to perform some other action than just project.save()

-- 
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/e8efdc18-af78-46c1-b275-1ae51dee8b39%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I don't understand why one of my jobs starts another

2016-04-13 Thread Erik Vande Velde
We have 3 automatic builds every night: (1) trunk (2) release 2.0 (3) 
release 1.1.
These 3 builds are built up out of flows defined with the 'Build Flow 
Plugin'. Since a couple of days some jobs out of one build start triggering 
jobs from another build, and I don't understand why. I just see messages 
like 
...
Started by upstream project Fugris2.0_Toolbox_Build build number 77
originally caused by:
Started by upstream project FugrisTrunk_Util_Testing build number 1179
... 
So apparently a job in the trunk flow decided to start a job in the release 
2.0 flow. How can i find out WHY jenkins thins that trunk_util wants to 
start 2.0_toolbox ?
The only workaround I see is to check 'disable triggering of downstream 
project' for each and every job (about 100 of them ...)

-- 
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/cdc29a9c-01aa-4745-a558-39ed8ef730e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.