Re: can I have concurrent steps in a pipeline?

2018-10-17 Thread Beushausen, Christian
Hi Don,

Why do step 3 and 4 have to run concurrently?
It sounds to me that burpsuite could be started as step 3, listening for 
connections. Then execute step 4 that runs against the running burpsuite 
instance. As a post step you could then let burpsuite finish processing 
whatever it's doing and then shut it down. Notify and archive afterwards as 
needed.
If step 4 fails have your post step handle the error accordingly.


Mit freundlichen Gruessen/Best regards,

Christian Beushausen
I S&T PD SW SWF
Interior Systems & Technology

Besucheradresse / Visitor address:
Continental Automotive GmbH
Philipsstrasse 1, 35576 Wetzlar, Germany

Rechnungsadresse / Invoice address:
Continental Automotive GmbH
Philipsstrasse 1, 35576 Wetzlar, Germany

Phone: +49 6441 370-9031
Mobile: +49 151 746 602 27
Fax: +49 6441 37013-9031
E-Mail: 
christian.beushau...@continental-corporation.com

<$$014!>


From: Don Raikes 
Sent: Wednesday, October 17, 2018 5:34:33 PM
To: jenkinsci-users@googlegroups.com
Subject: can I have concurrent steps in a pipeline?

Hi,

I am planning my first pipeline job, but I am not sure how to tell jenkins to 
run two of the steps concurrently.

Job outline:

Step 1. Clone from git
Step 2: build code from repository
Step 3: start burpsuite security proxy
Step 4: run tests on built code.

Steps 3 and 4 need to be run concurrently.  Step 3 starting burpsuite needs to 
start first, then once burpsuite is running step 4 needs to run to proxy my 
tests through burpsuite.  The automated tests in step 4 will finish then 
burpsuite will continue processing for some time after the tests have completed.

What is the best way to accomplish this?  I want Jenkins to notify me when the 
burpsuite processing is complete and to archive the burpsuite reports.

Thanks,
Don

--
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/2bba8324-25b6-415f-bd9d-6ddefd99fac6%40default.
For more options, visit https://groups.google.com/d/optout.

http://www.continental-corporation.com


Continental Automotive GmbH, Vahrenwalder Str. 9, D-30165 Hannover
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Helmut Matschi
Geschaeftsfuehrer/Managing Director: Georg Sistermanns, Harald Stuhlmann
Sitz der Gesellschaft/Registered Office: Hannover
Registergericht/Registered Court: Amtsgericht Hannover, HRB 59424
USt.-ID-Nr./VAT-ID-No. DE814950663

__

Proprietary and confidential. Distribution only by express authority of 
Continental AG or its subsidiaries.

-- 
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/AM0PR0302MB3410537FF9CD15E992D82A83CFF80%40AM0PR0302MB3410.eurprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script for backing up Jenkins

2018-10-17 Thread RAJENDRA PRASAD
Hi I can suggest two approaches here,
All Jenkins configuration (jobs config, credentials,...etc) will be saved
in  directory.

If it is running on Linux it must in /var/lib/Jenkins/ folder

On the same Linux machine install SVN/git client create a commnd to
check-in files.

You can run this command via Unix cron job.

Another approach is via Jenkins backup plugin.

Another approach is to use a seperate Jenkins job to run SVN/git check-in
command from build command.

But last approach may not work when all Jenkins executors are stuck while
running other jobs.

Thanks
Rajendra

On Tue 16 Oct, 2018, 6:33 AM ,  wrote:

> Hello,
>
> We are using Open Source Jenkins.  We want to backup the configuration and
> any changes happening in Jenkins everyday for recovery purpose.  Is there
> any scripts available for this purpose?  Jenkins is on Linux VM.
>
> --
> 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/1e628851-fdad-46fe-b71c-ce5a4c494a17%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/CAMrg02RKfv%2Bh2pSAskmEG_NKc8Btn30Yh4evvL4EGOfSv2A5_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script for backing up Jenkins

2018-10-17 Thread Sreeram Krishna
Hi
  What is your backup location?  I hope its not on the same server as the
Jenkins Master.

On Wed, Oct 17, 2018 at 2:22 PM  wrote:

> Thanks everyone for the update.  For now we are going with the Periodic
> Backup plugin which provides the backup of entire JENKINS_HOME.  This
> plugin works exactly the way we want.  But, we might end up with rsync
> option eventually.  Weighing in on each of the option.  Will keep posted.
> Thanks again everyone.
>
> On Wednesday, October 17, 2018 at 11:36:15 AM UTC-4, Sam K wrote:
>>
>> Glad to hear that Adam.
>>
>> On Tue, Oct 16, 2018, 11:03 AM Adam von Nieda  wrote:
>>
>>>
>>>   I have a similar setup for Disaster Recovery, and rsync the entire
>>> stack. Works like a charm, and I’ve tested within the last week.
>>>
>>> --
>>> Adam vonNieda
>>> ad...@vonnieda.org
>>>
>>>
>>>
>>>
>>> On Oct 16, 2018, at 11:05 AM, Sam K  wrote:
>>>
>>> Hi
>>>  I have a backup mechanism in place. I have a second Jenkins instance
>>> and I've been using rsync in a cronjob to keep sending all config.xmls and
>>> basically everything except build information and artifacts to the backup
>>> Jenkins. It send the information every 2 mins.
>>>
>>>  I remember testing it once and it worked as expected.  But it's been
>>> more than a year since the last testing to be honest.
>>>
>>> --
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/f475689a-c2d8-4c9a-8894-2682528f84ce%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/OeOFbzOtb_I/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/BDFEECE5-DB14-4A94-B604-64EC374309C9%40vonnieda.org
>>> 
>>> .
>>> 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/OeOFbzOtb_I/unsubscribe.
> To unsubscribe from this group and all its topics, 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/9cfb849a-d24a-4eec-9fb0-cdb745c21d21%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/CAKn1gMsSGTq%3DbyvakJUSmO7FEqe56-wojOmROM2EFc2Jux4JeA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script for backing up Jenkins

2018-10-17 Thread gotviseryon
Thanks everyone for the update.  For now we are going with the Periodic 
Backup plugin which provides the backup of entire JENKINS_HOME.  This 
plugin works exactly the way we want.  But, we might end up with rsync 
option eventually.  Weighing in on each of the option.  Will keep posted.  
Thanks again everyone.

On Wednesday, October 17, 2018 at 11:36:15 AM UTC-4, Sam K wrote:
>
> Glad to hear that Adam. 
>
> On Tue, Oct 16, 2018, 11:03 AM Adam von Nieda  > wrote:
>
>>
>>   I have a similar setup for Disaster Recovery, and rsync the entire 
>> stack. Works like a charm, and I’ve tested within the last week. 
>>
>> --
>> Adam vonNieda
>> ad...@vonnieda.org 
>>
>>
>>
>>
>> On Oct 16, 2018, at 11:05 AM, Sam K > 
>> wrote:
>>
>> Hi
>>  I have a backup mechanism in place. I have a second Jenkins instance and 
>> I've been using rsync in a cronjob to keep sending all config.xmls and 
>> basically everything except build information and artifacts to the backup 
>> Jenkins. It send the information every 2 mins. 
>>
>>  I remember testing it once and it worked as expected.  But it's been 
>> more than a year since the last testing to be honest. 
>>
>> -- 
>> 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-use...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/f475689a-c2d8-4c9a-8894-2682528f84ce%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/OeOFbzOtb_I/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/BDFEECE5-DB14-4A94-B604-64EC374309C9%40vonnieda.org
>>  
>> 
>> .
>> 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/9cfb849a-d24a-4eec-9fb0-cdb745c21d21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Update all plugins automatically

2018-10-17 Thread gotviseryon
Hi,

We are using open source Jenkins and have a bunch of plugins installed.  Is 
there a way to update all the plugins that are in the "Updates" section in 
the Plugin Manager?

-- 
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/3f542eb5-6e3c-4035-9fe9-ff0fee90b163%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Configure Linux and Windows slave node

2018-10-17 Thread gotviseryon
Hi,

Thanks for the link.  For Windows, I found this link more helpful 
- https://wiki.jenkins.io/pages/viewpage.action?pageId=75893612

On Monday, October 8, 2018 at 10:00:20 AM UTC-4, Pavel Novák wrote:
>
> Hi,
> there is a link with which describes step by step, how to add the agent , 
> new node 
> https://linuxacademy.com/blog/devops/adding-a-jenkins-agent-node/
>
> It seems to be possible add it via pipeline as well
>
> https://support.cloudbees.com/hc/en-us/articles/218154667-Create-a-Permanent-Agent-from-Groovy-Console
>
> launch methods are:
> - via ssh
> - via webstart
> - via execution command on master
> - control windows slave as windows service
>
> I have linux slaves made by ssh access and windows via webstart, eg. 
>
> Dne čtvrtek 4. října 2018 15:35:53 UTC+2 gotvi...@gmail.com napsal(a):
>>
>> What are the methods to configure a Linux and Windows slave node?
>>
>> Is there a runbook for it?
>>
>

-- 
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/cd8619b4-9bf5-4d0c-9d2d-51b6974773be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Shared groovy library frustration

2018-10-17 Thread Peter Berghold
Not sure if this is really what fixed the problem but here goes:

Destroyed the Docker instance running my Jenkins installation and rebuilt
it using LTS instead of the "latest and greatest bleeding edge" version.
Docker is a good thing that way. :-)

Now have a stripped down version and my simple shared library now works.
I'll move on to more complicated ones next.  Is this a problem with the
version I was using  dunno.


On Wed, Oct 17, 2018 at 2:29 PM Peter Berghold 
wrote:

> OK... seems this is somehow related to
> https://issues.jenkins-ci.org/browse/JENKINS-45260
>
> is there at least  a work-around?
>
> On Wed, Oct 17, 2018 at 10:16 AM Peter Berghold 
> wrote:
>
>> Interestingly enough on a Jenkins server i manage where I have working
>> shared libraries (multiple) I don't use the @Library form at all.  I tried
>> it on this other Jenkins server (the one I'm trying to *get* working) and
>> it didn't work.
>>
>> In my first attempt I simply used:
>>
>> @Library('lib3') _
>>
>> which I saw in this documentation:
>> https://jenkins.io/doc/book/pipeline/shared-libraries/
>>
>> that yielded me the following errors
>>
>> ERROR: No version specified for library lib3
>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
>> failed:
>> WorkflowScript: Loading libraries failed
>>
>>
>> OK fine,  I'll add a version to it which according to the cited page above 
>> can be a branch and "master" is certainly a branch.
>>
>>
>> @Library('lib3@master') _
>>
>>
>> Using that gave me more errors
>>
>> Loading library lib3@master
>> java.lang.NullPointerException
>>  at 
>> org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:82)
>>  at 
>> org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
>>  at 
>> org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
>>  at 
>> org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
>>  at 
>> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
>>  at 
>> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
>>  at 
>> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
>>  at 
>> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
>>  at 
>> groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
>>  at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
>>  at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
>>  at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
>>  at 
>> org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
>>  at 
>> org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
>>  at 
>> org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
>>  at 
>> org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
>>  at 
>> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:317)
>>  at hudson.model.ResourceController.execute(ResourceController.java:97)
>>  at hudson.model.Executor.run(Executor.java:429)
>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
>> failed:
>> WorkflowScript: Loading libraries failed
>>
>>
>> So what I'm wondering at this point, is there a plugin I'm missing?   What 
>> plugins are necessary to run Groovy pipelines including shared libraries?
>>
>>
>> I'm stumped here... and grasping at straws.
>>
>>
>> On Tue, Oct 16, 2018 at 6:29 PM Jan Monterrubio 
>> wrote:
>>
>>> Are you missing the @Library import in your pipeline?  Or does your
>>> shared library have a load implicitly declared?
>>>
>>> https://jenkins.io/doc/book/pipeline/shared-libraries/
>>>
>>>
>>>
>>> On Tue, Oct 16, 2018 at 14:49 Peter Berghold 
>>> wrote:
>>>
 Here is a tree of a very simple "library" I set up:

 ├── build.xml
 ├── manifest.mf
 ├── nbproject
 │   ├── build-impl.xml
 │   ├── genfiles.properties
 │   ├── groovy-build.xml
 │   ├── private
 │   │   ├── config.properties
 │   │   ├── private.properties
 │   │   └── private.xml
 │   ├── project.properties
 │   └── project.xml
 └── src
 ├── net
 │   └── berghold
 │   └── MainTest.groovy
 └── SimpleGroovyScript.groovy


 Most important of which is under "src" with the class MainTest

 Here is the class itself:

 /*
  * To change this license header, choose License Headers in Project
 Properties.
  * To change this template file, choose Tools | Templates
  * and open the template in the editor.
  */

 package net.berghold

 /**
  *
  * @author peter
  */
 class MainTest implements Serializable {
>

Re: Shared groovy library frustration

2018-10-17 Thread Peter Berghold
OK... seems this is somehow related to
https://issues.jenkins-ci.org/browse/JENKINS-45260

is there at least  a work-around?

On Wed, Oct 17, 2018 at 10:16 AM Peter Berghold 
wrote:

> Interestingly enough on a Jenkins server i manage where I have working
> shared libraries (multiple) I don't use the @Library form at all.  I tried
> it on this other Jenkins server (the one I'm trying to *get* working) and
> it didn't work.
>
> In my first attempt I simply used:
>
> @Library('lib3') _
>
> which I saw in this documentation:
> https://jenkins.io/doc/book/pipeline/shared-libraries/
>
> that yielded me the following errors
>
> ERROR: No version specified for library lib3
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> WorkflowScript: Loading libraries failed
>
>
> OK fine,  I'll add a version to it which according to the cited page above 
> can be a branch and "master" is certainly a branch.
>
>
> @Library('lib3@master') _
>
>
> Using that gave me more errors
>
> Loading library lib3@master
> java.lang.NullPointerException
>   at 
> org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:82)
>   at 
> org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
>   at 
> org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
>   at 
> org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
>   at 
> org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
>   at 
> org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
>   at 
> org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
>   at 
> org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
>   at 
> groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
>   at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
>   at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
>   at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
>   at 
> org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
>   at 
> org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
>   at 
> org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
>   at 
> org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
>   at 
> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:317)
>   at hudson.model.ResourceController.execute(ResourceController.java:97)
>   at hudson.model.Executor.run(Executor.java:429)
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> WorkflowScript: Loading libraries failed
>
>
> So what I'm wondering at this point, is there a plugin I'm missing?   What 
> plugins are necessary to run Groovy pipelines including shared libraries?
>
>
> I'm stumped here... and grasping at straws.
>
>
> On Tue, Oct 16, 2018 at 6:29 PM Jan Monterrubio 
> wrote:
>
>> Are you missing the @Library import in your pipeline?  Or does your
>> shared library have a load implicitly declared?
>>
>> https://jenkins.io/doc/book/pipeline/shared-libraries/
>>
>>
>>
>> On Tue, Oct 16, 2018 at 14:49 Peter Berghold 
>> wrote:
>>
>>> Here is a tree of a very simple "library" I set up:
>>>
>>> ├── build.xml
>>> ├── manifest.mf
>>> ├── nbproject
>>> │   ├── build-impl.xml
>>> │   ├── genfiles.properties
>>> │   ├── groovy-build.xml
>>> │   ├── private
>>> │   │   ├── config.properties
>>> │   │   ├── private.properties
>>> │   │   └── private.xml
>>> │   ├── project.properties
>>> │   └── project.xml
>>> └── src
>>> ├── net
>>> │   └── berghold
>>> │   └── MainTest.groovy
>>> └── SimpleGroovyScript.groovy
>>>
>>>
>>> Most important of which is under "src" with the class MainTest
>>>
>>> Here is the class itself:
>>>
>>> /*
>>>  * To change this license header, choose License Headers in Project
>>> Properties.
>>>  * To change this template file, choose Tools | Templates
>>>  * and open the template in the editor.
>>>  */
>>>
>>> package net.berghold
>>>
>>> /**
>>>  *
>>>  * @author peter
>>>  */
>>> class MainTest implements Serializable {
>>> def Object context
>>>
>>> def void runme(){
>>> context.sh('echo foobar')
>>> }
>>> }
>>>
>>> so far nothing earth shattering.  I've set up this shared library in the
>>> main Jenkins setup menu.   Should be groovy so far  but it isn't
>>>
>>> Here is a simple pipeline I set up to test this:
>>>
>>> import net.berghold.MainTest
>>>
>>> node('master'){
>>> step('run test'){
>>> def MainTest mt = new MainTest(context: this)
>>>
>>> mt.runme()
>>> }
>>> }
>>>
>>> When I try to "build" this I get the following error to the console:
>>>
>>> Running in Durabil

Help running 'aws elbv2 modify-listener --default-actions' in Jenkins pipeline

2018-10-17 Thread ZillaYT
I'm able to run this on my terminal (Macbook)

$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12 
--default-actions Type=redirect,RedirectConfig=
"{Protocol=HTTPS,Port=443,Host='#{host}',Query='#{query}',Path='/#{path}',StatusCode=HTTP_301}"

or

$ aws elbv2 modify-listener --listener-arn arn:aws:elasticloadbalancing:us-
east-1:123456789012:listener/app/sb-zift-admin-lb/123456789012/abcdefghij12 
--default-actions '[{"Type": "redirect", "RedirectConfig": {"Protocol": 
"HTTPS", "Port": "443", "Host": "#{host}", "Query": "#{query}", "Path": 
"/#{path}", "StatusCode": "HTTP_301"}}]'

But when I script this into Jenkins pipeline, it doesn't work for me. Like 
this...

def httpListenerArn = arn:myAWSlistener
def defaultActions = 
'[{\\"Type\\":\\"redirect\\",\\"RedirectConfig\\":{\\"Protocol\\":\\"HTTPS\\",\\"Port\\":\\"443\\",\\"Host\\":\\"#{host}\\",\\"Query\\":\\"#{query}\\",\\"Path\\":\\"/#{path}\\",\\"StatusCode\\":\\"HTTP_301\\"}}]'
sh = """
aws elbv2 modify-listener --listener-arn $httpListenerArn 
--default-actions \\'$defaultActions\\'
"""


I get this output on the console

+ aws elbv2 modify-listener --listener-arn arm:mySWSListener --default-actions 
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'

Error parsing parameter '--default-actions': Expected: '=', received: ''' for 
input: 
'[{"Type":"redirect","RedirectConfig":{"Protocol":"HTTPS","Port":"443","Host":"#{host}","Query":"#{query}","Path":"/#{path}","StatusCode":"HTTP_301"}}]'
 ^

If I cut/paste what Jenkins spits out (command after + in output console) onto 
my terminal, it works. Any clues?


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/0eba2ba3-4f84-490a-9cca-d559f8d80574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: can I have concurrent steps in a pipeline?

2018-10-17 Thread Slide
Depending on whether you are using scripted or declarative pipelines it's
done a little differently. Here is the declarative way:
https://jenkins.io/blog/2017/09/25/declarative-1/. Here is the scripted
way:
https://stackoverflow.com/questions/46834998/scripted-jenkinsfile-parallel-stage



On Wed, Oct 17, 2018 at 8:34 AM Don Raikes  wrote:

> Hi,
>
>
>
> I am planning my first pipeline job, but I am not sure how to tell jenkins
> to run two of the steps concurrently.
>
>
>
> Job outline:
>
>
>
> Step 1. Clone from git
>
> Step 2: build code from repository
>
> Step 3: start burpsuite security proxy
>
> Step 4: run tests on built code.
>
>
>
> Steps 3 and 4 need to be run concurrently.  Step 3 starting burpsuite
> needs to start first, then once burpsuite is running step 4 needs to run to
> proxy my tests through burpsuite.  The automated tests in step 4 will
> finish then burpsuite will continue processing for some time after the
> tests have completed.
>
>
>
> What is the best way to accomplish this?  I want Jenkins to notify me when
> the burpsuite processing is complete and to archive the burpsuite reports.
>
>
>
> Thanks,
>
> Don
>
> --
> 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/2bba8324-25b6-415f-bd9d-6ddefd99fac6%40default
> 
> .
> 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/CAPiUgVcHTO2oiXjH78y7D%2BKsq8MMrUyf0oJ77O%3DLcfbFLfsjQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Script for backing up Jenkins

2018-10-17 Thread Sreeram Krishna
Glad to hear that Adam.

On Tue, Oct 16, 2018, 11:03 AM Adam von Nieda  wrote:

>
>   I have a similar setup for Disaster Recovery, and rsync the entire
> stack. Works like a charm, and I’ve tested within the last week.
>
> --
> Adam vonNieda
> a...@vonnieda.org
>
>
>
>
> On Oct 16, 2018, at 11:05 AM, Sam K  wrote:
>
> Hi
>  I have a backup mechanism in place. I have a second Jenkins instance and
> I've been using rsync in a cronjob to keep sending all config.xmls and
> basically everything except build information and artifacts to the backup
> Jenkins. It send the information every 2 mins.
>
>  I remember testing it once and it worked as expected.  But it's been more
> than a year since the last testing to be honest.
>
> --
> 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/f475689a-c2d8-4c9a-8894-2682528f84ce%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/OeOFbzOtb_I/unsubscribe.
> To unsubscribe from this group and all its topics, 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/BDFEECE5-DB14-4A94-B604-64EC374309C9%40vonnieda.org
> 
> .
> 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/CAKn1gMtd4aiT2oNAvp0VB0fHx%2BT22DkYC1GGDCFuX%3DrxZbX55A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


can I have concurrent steps in a pipeline?

2018-10-17 Thread Don Raikes
Hi,

 

I am planning my first pipeline job, but I am not sure how to tell jenkins to 
run two of the steps concurrently.

 

Job outline:

 

Step 1. Clone from git

Step 2: build code from repository

Step 3: start burpsuite security proxy

Step 4: run tests on built code.

 

Steps 3 and 4 need to be run concurrently.  Step 3 starting burpsuite needs to 
start first, then once burpsuite is running step 4 needs to run to proxy my 
tests through burpsuite.  The automated tests in step 4 will finish then 
burpsuite will continue processing for some time after the tests have completed.

 

What is the best way to accomplish this?  I want Jenkins to notify me when the 
burpsuite processing is complete and to archive the burpsuite reports.

 

Thanks,

Don

-- 
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/2bba8324-25b6-415f-bd9d-6ddefd99fac6%40default.
For more options, visit https://groups.google.com/d/optout.


Jenkins master as Docker container, with restart

2018-10-17 Thread Zach LaCelle
I've installed the Jenkins master as a Docker container, following they
very good instructions here:

https://jenkins.io/doc/book/installing/#docker

However, the instructions list the "--rm" Docker option as a good way to
clean out the Jenkins container every time you restart. I'd like to have
Jenkins restart every time the machine is restarted, but you can't use --rm
and --restart simultaneously.

Does Jenkins suggest removing --rm and switching to --restart? Or is there
another method that people using the Docker image for a Jenkins master
prefer using?

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


Best way to set the job description for multi branch pipelines

2018-10-17 Thread Lee, David
Hi Jenkins users -

I am not seeing a really easy and clean way to set the Jenkins job description 
for multi branch pipelines.

The following code works, however, the downside is 3 in-process script 
approvals are required (method 
org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder$BadgeManager 
getBuild,  field hudson.model.Run project, and method hudson.model.AbstractItem 
setDescription java.lang.String).

def project = manager.build.project
project.setDescription("My job description.")

Am I missing something?  Is there a better way to codify the job description 
into a Jenkinsfile and without requiring any script approvals?   Would I need 
to create a  Jenkins plugin?

Any advice appreciated.  Thanks.
-D


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


Re: Shared groovy library frustration

2018-10-17 Thread Peter Berghold
Interestingly enough on a Jenkins server i manage where I have working
shared libraries (multiple) I don't use the @Library form at all.  I tried
it on this other Jenkins server (the one I'm trying to *get* working) and
it didn't work.

In my first attempt I simply used:

@Library('lib3') _

which I saw in this documentation:
https://jenkins.io/doc/book/pipeline/shared-libraries/

that yielded me the following errors

ERROR: No version specified for library lib3
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed


OK fine,  I'll add a version to it which according to the cited page
above can be a branch and "master" is certainly a branch.


@Library('lib3@master') _


Using that gave me more errors

Loading library lib3@master
java.lang.NullPointerException
at 
org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:82)
at 
org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:157)
at 
org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:138)
at 
org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
at 
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
at 
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
at 
groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:131)
at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:125)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:560)
at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:521)
at 
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:317)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: Loading libraries failed


So what I'm wondering at this point, is there a plugin I'm missing?
What plugins are necessary to run Groovy pipelines including shared
libraries?


I'm stumped here... and grasping at straws.


On Tue, Oct 16, 2018 at 6:29 PM Jan Monterrubio 
wrote:

> Are you missing the @Library import in your pipeline?  Or does your shared
> library have a load implicitly declared?
>
> https://jenkins.io/doc/book/pipeline/shared-libraries/
>
>
>
> On Tue, Oct 16, 2018 at 14:49 Peter Berghold 
> wrote:
>
>> Here is a tree of a very simple "library" I set up:
>>
>> ├── build.xml
>> ├── manifest.mf
>> ├── nbproject
>> │   ├── build-impl.xml
>> │   ├── genfiles.properties
>> │   ├── groovy-build.xml
>> │   ├── private
>> │   │   ├── config.properties
>> │   │   ├── private.properties
>> │   │   └── private.xml
>> │   ├── project.properties
>> │   └── project.xml
>> └── src
>> ├── net
>> │   └── berghold
>> │   └── MainTest.groovy
>> └── SimpleGroovyScript.groovy
>>
>>
>> Most important of which is under "src" with the class MainTest
>>
>> Here is the class itself:
>>
>> /*
>>  * To change this license header, choose License Headers in Project
>> Properties.
>>  * To change this template file, choose Tools | Templates
>>  * and open the template in the editor.
>>  */
>>
>> package net.berghold
>>
>> /**
>>  *
>>  * @author peter
>>  */
>> class MainTest implements Serializable {
>> def Object context
>>
>> def void runme(){
>> context.sh('echo foobar')
>> }
>> }
>>
>> so far nothing earth shattering.  I've set up this shared library in the
>> main Jenkins setup menu.   Should be groovy so far  but it isn't
>>
>> Here is a simple pipeline I set up to test this:
>>
>> import net.berghold.MainTest
>>
>> node('master'){
>> step('run test'){
>> def MainTest mt = new MainTest(context: this)
>>
>> mt.runme()
>> }
>> }
>>
>> When I try to "build" this I get the following error to the console:
>>
>> Running in Durability level: MAX_SURVIVABILITY
>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
>> failed:
>> WorkflowScript: 1: unable to resolve class net.berghold.MainTest
>>  @ line 1, column 1.
>>import net.berghold.MainTest
>>^
>>
>> 1 error
>>
>>
>> to me that implies the library is not being loaded for reasons I just
>> don't get.
>>
>> 

Re: Pipeline checkout persistence issue

2018-10-17 Thread Andrew Bayer
I'd advise moving the checkout logic into a shared library, fwiw.

A.

On Wed, Oct 17, 2018 at 2:00 PM James Chapman  wrote:

> Yeah, the default checkout is definitely the problem, even though it's
> "lightweight", it isn't. When I then perform a chekout step, once complete
> the default checkout reverts the directory and it then becomes
> "lightweight", so only the Jenkinsfiles remain and the source I'm trying to
> build evaporates.
>
> I added the skipDefaultCheckout() directive (thanks for that, Andrew, I
> didn't know it existed) but now the manual checkout step fails because it
> is in a seperate file. If I move the checkout into the primary Jenkinsfile
> it works, I can live with that for now, albeit a little bit annoying
> because the checkout is common.
>
> The other option that works is to completely remove the call to checkout
> because it does a full checkout by default.
>
> Either way, the default checkout seems to be the cause of my headaches and
> I now know how to get around it, thanks.
>
> James
>
>
>
> On Wed, 17 Oct 2018 at 11:25, Andrew Bayer  wrote:
>
>> You might want to add "skipDefaultCheckout(true)" to your options - it
>> could be that the automatic checkout that happens whenever you enter an
>> agent is messing things up.
>>
>> A.
>>
>> On Wed, Oct 17, 2018 at 11:40 AM James Chapman  wrote:
>>
>>> Hello Jenkins users,
>>>
>>> I have a pipeline job that run across a whole lot of different
>>> platforms. The job checks out source code on each node, builds on each
>>> node, runs tests on each node and then completes. Pretty straightforward!
>>> For some reason, when the checkout finishes, all the files that were
>>> just checked out get deleted and the build then fails because the required
>>> buildproj.pl file is missing. All that remains after the checkout step
>>> is the Jenkinsfiles.
>>>
>>> Can anyone help me understand why the checked out files are being
>>> deleted?
>>>
>>> Thanks
>>> James
>>>
>>>
>>>
>>> In the *project root* I have:
>>>
>>> build/
>>> jenkins/Jenkinsfile_svn_checkout
>>> source/
>>> buildproj.pl
>>> Jenkinsfile
>>>
>>>
>>> *Jenkinsfile_svn_checkout:*
>>>
>>> checkout poll: false,
>>> scm: [$class: 'SubversionSCM',
>>> additionalCredentials: [],
>>> excludedCommitMessages: '',
>>> excludedRegions: '',
>>> excludedRevprop: '',
>>> excludedUsers: 'userXYZ',
>>> filterChangelog: true,
>>> ignoreDirPropChanges: true,
>>> includedRegions: '',
>>> locations: [[cancelProcessOnExternalsFail: false,
>>> credentialsId: '----',
>>> depthOption: 'infinity',
>>> ignoreExternalsOption: false,
>>> local: '.',
>>> remote: "${g_subversion_url}/${params.SUBVERSION_BRANCH}"]],
>>> quietOperation: false,
>>> workspaceUpdater: [$class: 'UpdateUpdater']
>>> ]
>>>
>>>
>>> *Jenkinsfile*:
>>>
>>> pipeline {
>>>
>>> agent none
>>>
>>> parameters {
>>> booleanParam(name: 'BUILD_WINDOWS_32', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_WINDOWS_64', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_LINUX_32', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_LINUX_64', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_SOLARIS_10', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_FREEBSD_10', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_MAC_OSX_64', defaultValue: true,
>>> description: '')
>>> booleanParam(name: 'BUILD_AIX_PPC', defaultValue: true,
>>> description: '')
>>> string(name: 'SUBVERSION_BRANCH', defaultValue: 'trunk',
>>> description: '')
>>> }
>>>
>>> environment {
>>>
>>> String g_subversion_url = 'https://svn.project.url'
>>> int m_win64_code = 0
>>> int m_win32_code = 0
>>>
>>> }
>>>
>>> options {
>>> buildDiscarder(logRotator(numToKeepStr: '10'))
>>> timestamps()
>>> }
>>>
>>> triggers {
>>> pollSCM('H/5 * * * *')
>>> }
>>>
>>> stages {
>>>
>>> stage('Checkout Build Test') {
>>> failFast false
>>> parallel {
>>> stage('Windows 64') {
>>> agent {
>>> node {
>>> label 'WIN64'
>>> customWorkspace
>>> 'D:\\JENKINS\\Project_pipeline'
>>> }
>>> }
>>> steps {
>>> script {
>>> if (params.BUILD_WINDOWS_64) {
>>> load 'jenkins/Jenkinsfile_svn_checkout'
>>> m_win64_code = bat (returnStatus: true,
>>> script: '''perl buildproj.pl win64''')
>>> }
>>> }
>>> }
>>> }
>>

Re: Pipeline checkout persistence issue

2018-10-17 Thread James Chapman
Yeah, the default checkout is definitely the problem, even though it's
"lightweight", it isn't. When I then perform a chekout step, once complete
the default checkout reverts the directory and it then becomes
"lightweight", so only the Jenkinsfiles remain and the source I'm trying to
build evaporates.

I added the skipDefaultCheckout() directive (thanks for that, Andrew, I
didn't know it existed) but now the manual checkout step fails because it
is in a seperate file. If I move the checkout into the primary Jenkinsfile
it works, I can live with that for now, albeit a little bit annoying
because the checkout is common.

The other option that works is to completely remove the call to checkout
because it does a full checkout by default.

Either way, the default checkout seems to be the cause of my headaches and
I now know how to get around it, thanks.

James



On Wed, 17 Oct 2018 at 11:25, Andrew Bayer  wrote:

> You might want to add "skipDefaultCheckout(true)" to your options - it
> could be that the automatic checkout that happens whenever you enter an
> agent is messing things up.
>
> A.
>
> On Wed, Oct 17, 2018 at 11:40 AM James Chapman  wrote:
>
>> Hello Jenkins users,
>>
>> I have a pipeline job that run across a whole lot of different platforms.
>> The job checks out source code on each node, builds on each node, runs
>> tests on each node and then completes. Pretty straightforward!
>> For some reason, when the checkout finishes, all the files that were just
>> checked out get deleted and the build then fails because the required
>> buildproj.pl file is missing. All that remains after the checkout step
>> is the Jenkinsfiles.
>>
>> Can anyone help me understand why the checked out files are being
>> deleted?
>>
>> Thanks
>> James
>>
>>
>>
>> In the *project root* I have:
>>
>> build/
>> jenkins/Jenkinsfile_svn_checkout
>> source/
>> buildproj.pl
>> Jenkinsfile
>>
>>
>> *Jenkinsfile_svn_checkout:*
>>
>> checkout poll: false,
>> scm: [$class: 'SubversionSCM',
>> additionalCredentials: [],
>> excludedCommitMessages: '',
>> excludedRegions: '',
>> excludedRevprop: '',
>> excludedUsers: 'userXYZ',
>> filterChangelog: true,
>> ignoreDirPropChanges: true,
>> includedRegions: '',
>> locations: [[cancelProcessOnExternalsFail: false,
>> credentialsId: '----',
>> depthOption: 'infinity',
>> ignoreExternalsOption: false,
>> local: '.',
>> remote: "${g_subversion_url}/${params.SUBVERSION_BRANCH}"]],
>> quietOperation: false,
>> workspaceUpdater: [$class: 'UpdateUpdater']
>> ]
>>
>>
>> *Jenkinsfile*:
>>
>> pipeline {
>>
>> agent none
>>
>> parameters {
>> booleanParam(name: 'BUILD_WINDOWS_32', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_WINDOWS_64', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_LINUX_32', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_LINUX_64', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_SOLARIS_10', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_FREEBSD_10', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_MAC_OSX_64', defaultValue: true,
>> description: '')
>> booleanParam(name: 'BUILD_AIX_PPC', defaultValue: true,
>> description: '')
>> string(name: 'SUBVERSION_BRANCH', defaultValue: 'trunk',
>> description: '')
>> }
>>
>> environment {
>>
>> String g_subversion_url = 'https://svn.project.url'
>> int m_win64_code = 0
>> int m_win32_code = 0
>>
>> }
>>
>> options {
>> buildDiscarder(logRotator(numToKeepStr: '10'))
>> timestamps()
>> }
>>
>> triggers {
>> pollSCM('H/5 * * * *')
>> }
>>
>> stages {
>>
>> stage('Checkout Build Test') {
>> failFast false
>> parallel {
>> stage('Windows 64') {
>> agent {
>> node {
>> label 'WIN64'
>> customWorkspace
>> 'D:\\JENKINS\\Project_pipeline'
>> }
>> }
>> steps {
>> script {
>> if (params.BUILD_WINDOWS_64) {
>> load 'jenkins/Jenkinsfile_svn_checkout'
>> m_win64_code = bat (returnStatus: true,
>> script: '''perl buildproj.pl win64''')
>> }
>> }
>> }
>> }
>> stage('Windows 32') {
>> agent {
>> node {
>> label 'WIN32'
>> customWorkspace
>> 'D:\\JENKINS\\Project_pipeline'
>> }
>> }
>>

Unexpected behavior with environment variable expansion in Powershell plugin

2018-10-17 Thread t3knoid
I have a simple powershell script that simply runs the following:

Write-Output "myCommand myCommand -param $env:MyParameter"
myCommand -param $env:MyParameter

The first one writes out the command that is being executed below. The 
$env:MyParameter is expanded correctly with its value. However, the actual 
command that is executed on the next line, does not. The command myCommand 
gets the actual string that I pass, "$env:MyParameter."




-- 
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/4735c49d-d1a5-4213-955e-d0774411a6ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pipeline checkout persistence issue

2018-10-17 Thread Andrew Bayer
You might want to add "skipDefaultCheckout(true)" to your options - it
could be that the automatic checkout that happens whenever you enter an
agent is messing things up.

A.

On Wed, Oct 17, 2018 at 11:40 AM James Chapman  wrote:

> Hello Jenkins users,
>
> I have a pipeline job that run across a whole lot of different platforms.
> The job checks out source code on each node, builds on each node, runs
> tests on each node and then completes. Pretty straightforward!
> For some reason, when the checkout finishes, all the files that were just
> checked out get deleted and the build then fails because the required
> buildproj.pl file is missing. All that remains after the checkout step is
> the Jenkinsfiles.
>
> Can anyone help me understand why the checked out files are being deleted?
>
> Thanks
> James
>
>
>
> In the *project root* I have:
>
> build/
> jenkins/Jenkinsfile_svn_checkout
> source/
> buildproj.pl
> Jenkinsfile
>
>
> *Jenkinsfile_svn_checkout:*
>
> checkout poll: false,
> scm: [$class: 'SubversionSCM',
> additionalCredentials: [],
> excludedCommitMessages: '',
> excludedRegions: '',
> excludedRevprop: '',
> excludedUsers: 'userXYZ',
> filterChangelog: true,
> ignoreDirPropChanges: true,
> includedRegions: '',
> locations: [[cancelProcessOnExternalsFail: false,
> credentialsId: '----',
> depthOption: 'infinity',
> ignoreExternalsOption: false,
> local: '.',
> remote: "${g_subversion_url}/${params.SUBVERSION_BRANCH}"]],
> quietOperation: false,
> workspaceUpdater: [$class: 'UpdateUpdater']
> ]
>
>
> *Jenkinsfile*:
>
> pipeline {
>
> agent none
>
> parameters {
> booleanParam(name: 'BUILD_WINDOWS_32', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_WINDOWS_64', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_LINUX_32', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_LINUX_64', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_SOLARIS_10', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_FREEBSD_10', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_MAC_OSX_64', defaultValue: true,
> description: '')
> booleanParam(name: 'BUILD_AIX_PPC', defaultValue: true,
> description: '')
> string(name: 'SUBVERSION_BRANCH', defaultValue: 'trunk',
> description: '')
> }
>
> environment {
>
> String g_subversion_url = 'https://svn.project.url'
> int m_win64_code = 0
> int m_win32_code = 0
>
> }
>
> options {
> buildDiscarder(logRotator(numToKeepStr: '10'))
> timestamps()
> }
>
> triggers {
> pollSCM('H/5 * * * *')
> }
>
> stages {
>
> stage('Checkout Build Test') {
> failFast false
> parallel {
> stage('Windows 64') {
> agent {
> node {
> label 'WIN64'
> customWorkspace 'D:\\JENKINS\\Project_pipeline'
> }
> }
> steps {
> script {
> if (params.BUILD_WINDOWS_64) {
> load 'jenkins/Jenkinsfile_svn_checkout'
> m_win64_code = bat (returnStatus: true,
> script: '''perl buildproj.pl win64''')
> }
> }
> }
> }
> stage('Windows 32') {
> agent {
> node {
> label 'WIN32'
> customWorkspace 'D:\\JENKINS\\Project_pipeline'
> }
> }
> steps {
> script {
> if (params.BUILD_WINDOWS_32) {
> load 'jenkins/Jenkinsfile_svn_checkout'
> m_win32_code = bat (returnStatus: true,
> script: '''perl buildproj.pl win32''')
> }
> }
> }
> }
> // ... more stages for other platforms
> }
> }
>
> } // stages
>
> post {
>
> always {
> echo "Unit tests completed"
> }
>
> success {
> echo "All test passed"
> }
>
> failure {
> echo 'Unit tests failed'
> }
> }
> } // pipeline
>
>
>
> --
> 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
> h

Pipeline checkout persistence issue

2018-10-17 Thread James Chapman
Hello Jenkins users,

I have a pipeline job that run across a whole lot of different platforms.
The job checks out source code on each node, builds on each node, runs
tests on each node and then completes. Pretty straightforward!
For some reason, when the checkout finishes, all the files that were just
checked out get deleted and the build then fails because the required
buildproj.pl file is missing. All that remains after the checkout step is
the Jenkinsfiles.

Can anyone help me understand why the checked out files are being deleted?

Thanks
James



In the *project root* I have:

build/
jenkins/Jenkinsfile_svn_checkout
source/
buildproj.pl
Jenkinsfile


*Jenkinsfile_svn_checkout:*

checkout poll: false,
scm: [$class: 'SubversionSCM',
additionalCredentials: [],
excludedCommitMessages: '',
excludedRegions: '',
excludedRevprop: '',
excludedUsers: 'userXYZ',
filterChangelog: true,
ignoreDirPropChanges: true,
includedRegions: '',
locations: [[cancelProcessOnExternalsFail: false,
credentialsId: '----',
depthOption: 'infinity',
ignoreExternalsOption: false,
local: '.',
remote: "${g_subversion_url}/${params.SUBVERSION_BRANCH}"]],
quietOperation: false,
workspaceUpdater: [$class: 'UpdateUpdater']
]


*Jenkinsfile*:

pipeline {

agent none

parameters {
booleanParam(name: 'BUILD_WINDOWS_32', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_WINDOWS_64', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_LINUX_32', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_LINUX_64', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_SOLARIS_10', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_FREEBSD_10', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_MAC_OSX_64', defaultValue: true,
description: '')
booleanParam(name: 'BUILD_AIX_PPC', defaultValue: true,
description: '')
string(name: 'SUBVERSION_BRANCH', defaultValue: 'trunk',
description: '')
}

environment {

String g_subversion_url = 'https://svn.project.url'
int m_win64_code = 0
int m_win32_code = 0

}

options {
buildDiscarder(logRotator(numToKeepStr: '10'))
timestamps()
}

triggers {
pollSCM('H/5 * * * *')
}

stages {

stage('Checkout Build Test') {
failFast false
parallel {
stage('Windows 64') {
agent {
node {
label 'WIN64'
customWorkspace 'D:\\JENKINS\\Project_pipeline'
}
}
steps {
script {
if (params.BUILD_WINDOWS_64) {
load 'jenkins/Jenkinsfile_svn_checkout'
m_win64_code = bat (returnStatus: true,
script: '''perl buildproj.pl win64''')
}
}
}
}
stage('Windows 32') {
agent {
node {
label 'WIN32'
customWorkspace 'D:\\JENKINS\\Project_pipeline'
}
}
steps {
script {
if (params.BUILD_WINDOWS_32) {
load 'jenkins/Jenkinsfile_svn_checkout'
m_win32_code = bat (returnStatus: true,
script: '''perl buildproj.pl win32''')
}
}
}
}
// ... more stages for other platforms
}
}

} // stages

post {

always {
echo "Unit tests completed"
}

success {
echo "All test passed"
}

failure {
echo 'Unit tests failed'
}
}
} // pipeline

-- 
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/CAHvkzy%3DEtB_1umVBgUUC5rL8g-x%2BC9Zu1M%3DpB7St1mBazoWqbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Testing shared libraries locally

2018-10-17 Thread Hari Phaneendra
Yeah it works for us in most cases. But if people want to test it locally
before pushing their changes to remote repository then it is an extra step.
Also any new branch a dev is working on requires local jenkins to be
updated to point to the branch on shared library or update the jenkinsfile
to use this branch. The idea is to see if we can take out the SCM for
testing local changes.

On Tue, Oct 16, 2018 at 4:49 PM James Fairweather <
james.fairweat...@blackbirdinteractive.com> wrote:

> Why don't you want to go through GitHub?  That workflow works really well
> in my experience.
>
> On Tue, Oct 16, 2018, 4:24 PM Hari Phaneendra,  wrote:
>
>> Hi,
>> I am looking for ideas on how to test shared libraries locally without
>> having to push my changes to github and have my local jenkins point to the
>> remote repo? Is it possible to setup jenkins to look for shared libraries
>> on local absolute paths?
>>
>> --
>> 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/a2aeec0e-55d1-4ef7-b7d5-a1bfa667bc4f%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/CALg80NXOKnLmvVDAa5PNDnCqq1jttrD17irgtSM-furBmi3z%2BQ%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/CAKDrMGPT1hTqW3jVBc3G8j154U2j4Tf2iqY66qtzZ6C%3D4cJ4Tg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.