Jenkins programming using DSL

2019-07-09 Thread chenna keshav
Hi Guys,

I am new to Jenkins... Can any one suggest a tutorial to learn Jenkins 
programming using DSL..

Thanks,
Keshav.

-- 
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/0de9d39f-fa6a-456d-993f-9cbd092a84bd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Java GUI tests fail on Jenkins but not on my local machine

2019-07-09 Thread Sakshi Arora
Hi All,

I have some Java Swing Gui tests in my applications. Whenever, I run them
locally, they run without any failures/errors. But when I run them on
Jenkins, they fail randomly.

All of the failures are GUI based- for example pop-up menu never appeared.

Is there any way I can run them successfully on the headless Jenkins
machine?


Thanks & Regards,
Sakshi

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


Re: Need help running a Jenkins job from VBScript using JenkinsAPI

2019-07-09 Thread Slide
You would have to implement a function to base64 encode the data (I should
have mentioned that in my previous post).

On Tue, Jul 9, 2019 at 2:41 PM D. C.  wrote:

> Thanks for the suggestions.  I had actually already tried "HttpReq.Open
> "POST", strJenkinsURL, False, strUsername, strPassword" and it didn't
> help.  Since the error returned has to do with the crumb (403 No valid
> crumb was included), I hoped the auth part was actually working, but maybe
> not.  I have tried again with passing the username/password as part of the
> Open method, but still no luck there.
>
> I tried the .setRequestHeader "Authentication" like you showed but it
> returns "Type mismatch: 'Base64Encode'" so something is wrong with the
> syntax.
>
>
> On Tuesday, July 9, 2019 at 2:06:57 PM UTC-5, slide wrote:
>>
>> I think you want to pass the username/password as part of the Open method
>> call
>>
>> HttpReq.Open "POST", strJenkinsURL, False, strUsername, strPassword
>>
>> In addition, you may need to set an Authorization header, but I am not
>> sure how the  MSXML2.ServerXMLHTTP object handles that if you pass the
>> username/password with the Open call.
>>
>> You would need to do something like this if just passing it via the Open
>> method doesn't work:
>>
>> HttpReq.setRequestHeader "Authentication", "Basic " &
>> Base64Encode(strUsername & ":" & strPassword)
>>
>> On Tue, Jul 9, 2019 at 10:54 AM D. C.  wrote:
>>
>>> I have searched all over but haven't found a solution to this. The
>>> JenkinsAPI page doesn't provide information on using VBScript either.
>>> I am trying to start a job in Jenkins from a classic ASP web page (so
>>> VBScript - code below).  I used wget from examples on the Jenkins API page
>>> to get the Jenkins crumb. The testjob is configured with "Trigger builds
>>> remotely" and I included the token in the URL string as specified in the
>>> examples on the Jenkins API page. I am unsure if the login information is
>>> setup correctly in my .setRequestHeader, but the error I am getting is "No
>>> valid crumb" even though I include the crumb in the header.  Can anyone
>>> tell me if the .setRequestHeaders are in the correct format or anything
>>> else that might help me get this to work?  I have also tried using curl to
>>> start the job, but that doesn't start the job, but it also doesn't return
>>> an error. From what I have found, curl should return an HTTP 201 response
>>> to indicate the job was started. I'm not getting that.  I would prefer to
>>> start the job from VBScript; curl was just for a test.
>>>
>>> VBScript:
>>> --
>>> Dim strJenkinsURL, HttpReq
>>> strJenkinsURL = "http://
>>> /job/testjob/buildWithParameters?token=test&Description=sometext"
>>>
>>> Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
>>> HttpReq.Open "POST", strJenkinsURL, False
>>> HttpReq.setRequestHeader "UserName", ""
>>> HttpReq.setRequestHeader "Password", ""
>>> HttpReq.setRequestHeader "Jenkins-Crumb", ""
>>> HttpReq.Send
>>> Response.Write "Status: "& HttpReq.Status & vbNewline
>>> Response.Write "Response: "& HttpReq.responseText & vbNewline
>>>
>>> Result
>>> -
>>> Status: 403
>>> Response: HTTP ERROR 403
>>> Problem accessing /job/testjob/buildWithParameters. Reason: No valid
>>> crumb was included in the request
>>>
>>> curl:
>>> 
>>> curl -v --user : -X POST "
>>> http://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext";
>>> -H "Jenkins-Crumb:"
>>>
>>> * timeout on name lookup is not supported
>>> *   Trying xxx.xxx.xxx.xxx...
>>> * TCP_NODELAY set
>>>   % Total% Received % Xferd  Average Speed   TimeTime Time
>>> Current
>>>  Dload  Upload   Total   SpentLeft
>>> Speed
>>>   0 00 00 0  0  0 --:--:-- --:--:--
>>> --:--:-- 0* Connected to jenkinsurl (xxx.xxx.xxx.xxx) port 80 (#0)
>>> * Server auth using Basic with user 'jenkinsuser'
>>> > POST /job/testjob/buildWithParameters?token=test&Description=sometext
>>> HTTP/1.1
>>> > Host: jenkinsurl
>>> > Authorization: Basic Y3MyYXV0b3Rlc3Q6QXV0b21hdGlvbjE=
>>> > User-Agent: curl/7.55.0
>>> > Accept: */*
>>> > Jenkins-Crumb:
>>> >
>>> * HTTP 1.0, assume close after body
>>> < HTTP/1.0 302 Found
>>> < Location:
>>> https://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext
>>> < Server: BigIP
>>> * HTTP/1.0 connection set to keep alive!
>>> < Connection: Keep-Alive
>>> < Content-Length: 0
>>> <
>>>   0 00 00 0  0  0 --:--:-- --:--:--
>>> --:--:-- 0
>>> * Connection #0 to host jenkinsurl left intact
>>>
>>> --
>>> 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 jenkins...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/m

Re: Need help running a Jenkins job from VBScript using JenkinsAPI

2019-07-09 Thread D. C.
Thanks for the suggestions.  I had actually already tried "HttpReq.Open 
"POST", strJenkinsURL, False, strUsername, strPassword" and it didn't 
help.  Since the error returned has to do with the crumb (403 No valid 
crumb was included), I hoped the auth part was actually working, but maybe 
not.  I have tried again with passing the username/password as part of the 
Open method, but still no luck there.

I tried the .setRequestHeader "Authentication" like you showed but it 
returns "Type mismatch: 'Base64Encode'" so something is wrong with the 
syntax.


On Tuesday, July 9, 2019 at 2:06:57 PM UTC-5, slide wrote:
>
> I think you want to pass the username/password as part of the Open method 
> call
>
> HttpReq.Open "POST", strJenkinsURL, False, strUsername, strPassword
>
> In addition, you may need to set an Authorization header, but I am not 
> sure how the  MSXML2.ServerXMLHTTP object handles that if you pass the 
> username/password with the Open call.
>
> You would need to do something like this if just passing it via the Open 
> method doesn't work:
>
> HttpReq.setRequestHeader "Authentication", "Basic " & 
> Base64Encode(strUsername & ":" & strPassword)
>
> On Tue, Jul 9, 2019 at 10:54 AM D. C. > 
> wrote:
>
>> I have searched all over but haven't found a solution to this. The 
>> JenkinsAPI page doesn't provide information on using VBScript either.
>> I am trying to start a job in Jenkins from a classic ASP web page (so 
>> VBScript - code below).  I used wget from examples on the Jenkins API page 
>> to get the Jenkins crumb. The testjob is configured with "Trigger builds 
>> remotely" and I included the token in the URL string as specified in the 
>> examples on the Jenkins API page. I am unsure if the login information is 
>> setup correctly in my .setRequestHeader, but the error I am getting is "No 
>> valid crumb" even though I include the crumb in the header.  Can anyone 
>> tell me if the .setRequestHeaders are in the correct format or anything 
>> else that might help me get this to work?  I have also tried using curl to 
>> start the job, but that doesn't start the job, but it also doesn't return 
>> an error. From what I have found, curl should return an HTTP 201 response 
>> to indicate the job was started. I'm not getting that.  I would prefer to 
>> start the job from VBScript; curl was just for a test.
>>
>> VBScript:
>> --
>> Dim strJenkinsURL, HttpReq
>> strJenkinsURL = 
>> "http:///job/testjob/buildWithParameters?token=test&Description=sometext"
>>
>> Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
>> HttpReq.Open "POST", strJenkinsURL, False
>> HttpReq.setRequestHeader "UserName", ""
>> HttpReq.setRequestHeader "Password", ""
>> HttpReq.setRequestHeader "Jenkins-Crumb", ""
>> HttpReq.Send
>> Response.Write "Status: "& HttpReq.Status & vbNewline
>> Response.Write "Response: "& HttpReq.responseText & vbNewline
>>
>> Result
>> -
>> Status: 403
>> Response: HTTP ERROR 403
>> Problem accessing /job/testjob/buildWithParameters. Reason: No valid 
>> crumb was included in the request
>>
>> curl:
>> 
>> curl -v --user : -X POST "
>> http://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext";
>>  
>> -H "Jenkins-Crumb:"
>>
>> * timeout on name lookup is not supported
>> *   Trying xxx.xxx.xxx.xxx...
>> * TCP_NODELAY set
>>   % Total% Received % Xferd  Average Speed   TimeTime Time  
>> Current
>>  Dload  Upload   Total   SpentLeft  
>> Speed
>>   0 00 00 0  0  0 --:--:-- --:--:-- 
>> --:--:-- 0* Connected to jenkinsurl (xxx.xxx.xxx.xxx) port 80 (#0)
>> * Server auth using Basic with user 'jenkinsuser'
>> > POST /job/testjob/buildWithParameters?token=test&Description=sometext 
>> HTTP/1.1
>> > Host: jenkinsurl
>> > Authorization: Basic Y3MyYXV0b3Rlc3Q6QXV0b21hdGlvbjE=
>> > User-Agent: curl/7.55.0
>> > Accept: */*
>> > Jenkins-Crumb:
>> >
>> * HTTP 1.0, assume close after body
>> < HTTP/1.0 302 Found
>> < Location: 
>> https://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext
>> < Server: BigIP
>> * HTTP/1.0 connection set to keep alive!
>> < Connection: Keep-Alive
>> < Content-Length: 0
>> <
>>   0 00 00 0  0  0 --:--:-- --:--:-- 
>> --:--:-- 0
>> * Connection #0 to host jenkinsurl left intact
>>
>> -- 
>> 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 jenkins...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/acd05793-f5c3-47c1-9049-75835b7933a2%40googlegroups.com
>>  
>> 
>> .
>> For

Re: Need help running a Jenkins job from VBScript using JenkinsAPI

2019-07-09 Thread Slide
I think you want to pass the username/password as part of the Open method
call

HttpReq.Open "POST", strJenkinsURL, False, strUsername, strPassword

In addition, you may need to set an Authorization header, but I am not sure
how the  MSXML2.ServerXMLHTTP object handles that if you pass the
username/password with the Open call.

You would need to do something like this if just passing it via the Open
method doesn't work:

HttpReq.setRequestHeader "Authentication", "Basic " &
Base64Encode(strUsername & ":" & strPassword)

On Tue, Jul 9, 2019 at 10:54 AM D. C.  wrote:

> I have searched all over but haven't found a solution to this. The
> JenkinsAPI page doesn't provide information on using VBScript either.
> I am trying to start a job in Jenkins from a classic ASP web page (so
> VBScript - code below).  I used wget from examples on the Jenkins API page
> to get the Jenkins crumb. The testjob is configured with "Trigger builds
> remotely" and I included the token in the URL string as specified in the
> examples on the Jenkins API page. I am unsure if the login information is
> setup correctly in my .setRequestHeader, but the error I am getting is "No
> valid crumb" even though I include the crumb in the header.  Can anyone
> tell me if the .setRequestHeaders are in the correct format or anything
> else that might help me get this to work?  I have also tried using curl to
> start the job, but that doesn't start the job, but it also doesn't return
> an error. From what I have found, curl should return an HTTP 201 response
> to indicate the job was started. I'm not getting that.  I would prefer to
> start the job from VBScript; curl was just for a test.
>
> VBScript:
> --
> Dim strJenkinsURL, HttpReq
> strJenkinsURL = "http://
> /job/testjob/buildWithParameters?token=test&Description=sometext"
>
> Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
> HttpReq.Open "POST", strJenkinsURL, False
> HttpReq.setRequestHeader "UserName", ""
> HttpReq.setRequestHeader "Password", ""
> HttpReq.setRequestHeader "Jenkins-Crumb", ""
> HttpReq.Send
> Response.Write "Status: "& HttpReq.Status & vbNewline
> Response.Write "Response: "& HttpReq.responseText & vbNewline
>
> Result
> -
> Status: 403
> Response: HTTP ERROR 403
> Problem accessing /job/testjob/buildWithParameters. Reason: No valid crumb
> was included in the request
>
> curl:
> 
> curl -v --user : -X POST "
> http://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext";
> -H "Jenkins-Crumb:"
>
> * timeout on name lookup is not supported
> *   Trying xxx.xxx.xxx.xxx...
> * TCP_NODELAY set
>   % Total% Received % Xferd  Average Speed   TimeTime Time
> Current
>  Dload  Upload   Total   SpentLeft
> Speed
>   0 00 00 0  0  0 --:--:-- --:--:--
> --:--:-- 0* Connected to jenkinsurl (xxx.xxx.xxx.xxx) port 80 (#0)
> * Server auth using Basic with user 'jenkinsuser'
> > POST /job/testjob/buildWithParameters?token=test&Description=sometext
> HTTP/1.1
> > Host: jenkinsurl
> > Authorization: Basic Y3MyYXV0b3Rlc3Q6QXV0b21hdGlvbjE=
> > User-Agent: curl/7.55.0
> > Accept: */*
> > Jenkins-Crumb:
> >
> * HTTP 1.0, assume close after body
> < HTTP/1.0 302 Found
> < Location:
> https://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext
> < Server: BigIP
> * HTTP/1.0 connection set to keep alive!
> < Connection: Keep-Alive
> < Content-Length: 0
> <
>   0 00 00 0  0  0 --:--:-- --:--:--
> --:--:-- 0
> * Connection #0 to host jenkinsurl left intact
>
> --
> 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/acd05793-f5c3-47c1-9049-75835b7933a2%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Website: http://earl-of-code.com

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


Need help running a Jenkins job from VBScript using JenkinsAPI

2019-07-09 Thread D. C.
I have searched all over but haven't found a solution to this. The 
JenkinsAPI page doesn't provide information on using VBScript either.
I am trying to start a job in Jenkins from a classic ASP web page (so 
VBScript - code below).  I used wget from examples on the Jenkins API page 
to get the Jenkins crumb. The testjob is configured with "Trigger builds 
remotely" and I included the token in the URL string as specified in the 
examples on the Jenkins API page. I am unsure if the login information is 
setup correctly in my .setRequestHeader, but the error I am getting is "No 
valid crumb" even though I include the crumb in the header.  Can anyone 
tell me if the .setRequestHeaders are in the correct format or anything 
else that might help me get this to work?  I have also tried using curl to 
start the job, but that doesn't start the job, but it also doesn't return 
an error. From what I have found, curl should return an HTTP 201 response 
to indicate the job was started. I'm not getting that.  I would prefer to 
start the job from VBScript; curl was just for a test.

VBScript:
--
Dim strJenkinsURL, HttpReq
strJenkinsURL = 
"http:///job/testjob/buildWithParameters?token=test&Description=sometext"

Set HttpReq = Server.CreateObject("MSXML2.ServerXMLHTTP")
HttpReq.Open "POST", strJenkinsURL, False
HttpReq.setRequestHeader "UserName", ""
HttpReq.setRequestHeader "Password", ""
HttpReq.setRequestHeader "Jenkins-Crumb", ""
HttpReq.Send
Response.Write "Status: "& HttpReq.Status & vbNewline
Response.Write "Response: "& HttpReq.responseText & vbNewline

Result
-
Status: 403
Response: HTTP ERROR 403
Problem accessing /job/testjob/buildWithParameters. Reason: No valid crumb 
was included in the request

curl:

curl -v --user : -X POST 
"http://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext";
 
-H "Jenkins-Crumb:"

* timeout on name lookup is not supported
*   Trying xxx.xxx.xxx.xxx...
* TCP_NODELAY set
  % Total% Received % Xferd  Average Speed   TimeTime Time  
Current
 Dload  Upload   Total   SpentLeft  
Speed
  0 00 00 0  0  0 --:--:-- --:--:-- 
--:--:-- 0* Connected to jenkinsurl (xxx.xxx.xxx.xxx) port 80 (#0)
* Server auth using Basic with user 'jenkinsuser'
> POST /job/testjob/buildWithParameters?token=test&Description=sometext 
HTTP/1.1
> Host: jenkinsurl
> Authorization: Basic Y3MyYXV0b3Rlc3Q6QXV0b21hdGlvbjE=
> User-Agent: curl/7.55.0
> Accept: */*
> Jenkins-Crumb:
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
< Location: 
https://jenkinsurl/job/testjob/buildWithParameters?token=test&Description=sometext
< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
<
  0 00 00 0  0  0 --:--:-- --:--:-- 
--:--:-- 0
* Connection #0 to host jenkinsurl left intact

-- 
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/acd05793-f5c3-47c1-9049-75835b7933a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there a way how to use template from email extension template plugin(emailexttemplates) in pipeline?

2019-07-09 Thread Vladimir Zak
Hi, thanks.

Is there a way to have a email templates in files and then using some
scripting to fill emailext pipeline steps with the predefined body,
subject, recepients,...

Thanks

Vladimir

Dne út 9. čvc 2019 16:30 uživatel Slide  napsal:

> There is not currently a way to do this.
>
> On Tue, Jul 9, 2019 at 5:16 AM zakyn  wrote:
>
>> Hello,
>>
>> we are using the email extension template plugin (
>> https://plugins.jenkins.io/emailext-template) where we can define
>> different email templates and then send them.
>>
>> Is there a way how we could use it in pipeline please (select predefined
>> template and send emails)?
>>
>> Thank you.
>>
>> Vladimir
>>
>> --
>> 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/a0b706c5-014c-45e0-91d6-3aa39e9ad97d%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Website: http://earl-of-code.com
>
> --
> 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/CAPiUgVeKtZoVTRAMwywopmEdmDRuh1dTSa%3DhrY9ra3NDbG%3D3dQ%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/CAHRFW7jvY4Wvak8rHuTG8BDPRWc9C36btXVyr7Pva6vih%3DoRrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there a way how to use template from email extension template plugin(emailexttemplates) in pipeline?

2019-07-09 Thread Slide
There is not currently a way to do this.

On Tue, Jul 9, 2019 at 5:16 AM zakyn  wrote:

> Hello,
>
> we are using the email extension template plugin (
> https://plugins.jenkins.io/emailext-template) where we can define
> different email templates and then send them.
>
> Is there a way how we could use it in pipeline please (select predefined
> template and send emails)?
>
> Thank you.
>
> Vladimir
>
> --
> 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/a0b706c5-014c-45e0-91d6-3aa39e9ad97d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Website: http://earl-of-code.com

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


Re: Running jobs sequentially on Jenkins ?

2019-07-09 Thread Mark Waite
https://jenkins.io/doc/book/pipeline/  is the online documentation for
Jenkins Pipeline.

There are also several Jenkins Minute video tutorials

available
from YouTube

   - Creating your first Pipeline in Blue Ocean -
   https://www.youtube.com/watch?v=FhDomw6BaHU
   - Recording test results and artifacts -
   https://www.youtube.com/watch?v=c9E8kGuAwLU
   

   - Parallel stages -  https://www.youtube.com/watch?v=cCSZx3HmCwY
   

   - Conditional stages -  https://www.youtube.com/watch?v=YWb5Is6VwPg
   

   - Using git environment variables -
   https://www.youtube.com/watch?v=tziVDpNYlgM
   


CloudBees also offers a free self-paced course, "Pipeline Fundamentals" at
https://standard.cbu.cloudbees.com/cloudbees-university-jenkins-pipeline-fundamentals

There is also a 24 minute video on creating a Pipeline with Blue Ocean at
https://www.youtube.com/watch?v=LzFmTiH8nos


On Tue, Jul 9, 2019 at 6:35 AM srinivasa rao 
wrote:

> Request to everyone please share Jenkins pipeline flow document
>
> --
> 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/0cb1d349-16bf-4039-8973-5286b8d98f05%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

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


Re: Problem with location of ANT build.xml file

2019-07-09 Thread Jannet Abdelkefi
Hi 

I'm also new to jenkins and i'm trying to do  a  unit test  but i'm using 
also ANT for the jobs but i did not  find this build.xml. 
My questions is where does this build.xml come from?  Do i have to create 
the file manually ? 

Hope can somebody help me .. 
Thank you for your time


Le dimanche 1 mai 2011 07:05:14 UTC+1, Didier Durand a écrit :
>
> Hi, 
>
> What Chris says is the solution. 
>
> But, why don't you rather try to move your build file in the directory 
> where ant is searching for it. That would make on parameter less in 
> your Jenkins config: less parameters is always better. 
>
> That means that you may have to move the build.xml file in your source 
> code repository so that it is downloaded in the right place next time 
> Jenkibs needs to do it. 
>
> regards 
>
> didier 
>
> On Apr 29, 7:35 pm, Chris Marks  wrote: 
> > You can change where the build script is by going to the "Configure" 
> page, 
> > and under your "Invoke Ant" build step, click the "Advanced" button. 
> >  There's a line for "Build File" that specifies the path relative to the 
> > workspace where the build file exists. 
> > 
> > Hope this helps. 
> > 
> > Thanks, 
> > topher 
> > 
> > On Tue, Apr 26, 2011 at 5:06 AM, M.Hueber  
> wrote: 
> > > sorry to ask again... 
> > > but I am still in trouble - and really desperate - waiting for 
> aswers/ideas 
> > > This problem might be very obvious and easy to solve, but I am not 
> able to 
> > > find it. 
> > 
> > > Dont think if it helps but  this is my console output for the job 
> ... 
> > 
> > > Sync complete, took 220781 ms 
> > > FATAL: Unable to find build script at 
> > > D:\jenkins\jobs\JOB1\workspace\build.xml 
> > > Notifying upstream projects of job completion 
> > 
> > > I updated Jenkins to Jenkins ver. 1.409 
> > 
> > > I am happy about any idea - how to re-/set the location for the ANT 
> > > build.xml file. 
> > > thx 
> > > M. 
> > 
> > > -- 
> > > View this message in context: 
> > >http://jenkins.361315.n4.nabble.com/Problem-with-location-of-ANT-buil... 
>
> > > Sent from the Jenkins users mailing list archive at Nabble.com. 
> > 
> >

-- 
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/cd6182ef-fc11-410b-88b9-9aa18acdcafd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running jobs sequentially on Jenkins ?

2019-07-09 Thread srinivasa rao
Request to everyone please share Jenkins pipeline flow document 

-- 
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/0cb1d349-16bf-4039-8973-5286b8d98f05%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Is there a way how to use template from email extension template plugin(emailexttemplates) in pipeline?

2019-07-09 Thread zakyn
Hello,

we are using the email extension template plugin 
(https://plugins.jenkins.io/emailext-template) where we can define 
different email templates and then send them.

Is there a way how we could use it in pipeline please (select predefined 
template and send emails)?

Thank you.

Vladimir

-- 
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/a0b706c5-014c-45e0-91d6-3aa39e9ad97d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Memory issues with Jenkins

2019-07-09 Thread Sverre Moe
Could it be issue with the virtual memory in the jenkins server? Because 
Jenkins does consume a lot of virtual memory.

  PID USER  PR  NIVIRTRESSHR S  %CPU  %MEM TIME+ 
COMMAND
13565 jenkins   20   0 12.641g 0.011t  13552 S 0.000 56.62 625:25.18 
/usr/bin/java -XX:+UseG1GC -Xmx10g

It has amassed 12G of virtual memory. It is a problem with java and glibc
that can be remedied with
MALLOC_ARENA_MAX=1

I have tried adding ENVIRONMENT to /etc/systemd/system/jenkins.service, but 
it is not set before running jenkins.

https://www.ibm.com/developerworks/community/blogs/kevgrig/entry/linux_glibc_2_10_rhel_6_malloc_may_show_excessive_virtual_memory_usage?lang=en

https://stackoverflow.com/questions/561245/virtual-memory-usage-from-java-under-linux-too-much-memory-used/28935176#28935176


tirsdag 9. juli 2019 13.24.18 UTC+2 skrev Sverre Moe følgende:
>
>
> Since we don't use 32bit, the reason must be
> - the virtual memory of the OS has been fully depleted
>
> How can I check for this, and remedy it?
>
> fredag 5. juli 2019 03.17.38 UTC+2 skrev Jan Monterrubio følgende:
>
>> Correct me if I’m wrong but I don’t think increasing heap size will 
>> actually affect your ability to create more native threads. 
>>
>> See this for a possible explanation: 
>> https://plumbr.io/outofmemoryerror/unable-to-create-new-native-thread
>>
>> On Thu, Jul 4, 2019 at 16:03 Baptiste Mathus  wrote:
>>
>>> Did you enable GC logging to have a better understanding of the profile 
>>> of your memory consumption? If not, I would recommend you do it first and 
>>> analyze them.
>>> https://jenkins.io/blog/2016/11/21/gc-tuning/ explained this part (and 
>>> much more) quite well.
>>>
>>> Then, once you understand better when it crashes, possibly you'll want 
>>> to analyze a heap dump to see what is causing the problem.
>>>
>>> Cheers
>>>
>>>
>>> Le mar. 2 juil. 2019 à 15:30, Sverre Moe  a écrit :
>>>
 Today it has been chaotic.
 Several build agents disconnected

 Unexpected termination of the channel

 Many builds failed because of Memory error.

 I have tried restarting Jenkins several times today.

 Anyone have any suggestions?

 tirsdag 2. juli 2019 14.34.25 UTC+2 skrev Sverre Moe følgende:
>
> We have assigned 8GB of memory to our Jenkins instance.
> JAVA_OPTIONS=-Xmx8g
>
> Still we experience memory issues after a while running.
> java.lang.OutOfMemoryError: unable to create new native thread
>
> We have:
> aprox 40 connected build agents
> aprox 400 pipeline jobs
>
> We have a test Jenkins instance running with the same jobs, this one 
> connects to the same build agents (though on a different home directory).
>
> Lately we have been getting disconnected build agents, that we cannot 
> get up again without restarting Jenkins.
>
> Can we assign more memory to a build agent? Would it have any affect 
> on this issue?
>
> This we got from one of our latest Pipeline builds that failed on a 
> sh("find  -exec ***") step. It failed on that build agent that is now 
> disconnected.
>
>
> java.lang.OutOfMemoryError: unable to create new native thread
>   at java.lang.Thread.start0(Native Method)
>   at java.lang.Thread.start(Thread.java:714)
>   at 
> java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
>   at 
> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1368)
>   at java.lang.UNIXProcess.initStreams(UNIXProcess.java:288)
>   at java.lang.UNIXProcess.lambda$new$2(UNIXProcess.java:258)
>   at java.security.AccessController.doPrivileged(Native Method)
>   at java.lang.UNIXProcess.(UNIXProcess.java:257)
>   at java.lang.ProcessImpl.start(ProcessImpl.java:134)
>   at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
>   at hudson.Proc$LocalProc.(Proc.java:249)
> Also:   java.io.IOException: error=11, Resource temporarily unavailable
>
>
>
>
> SEVERE: Unexpected error when retrieving changeset 
> hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M 
> "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> % 
> ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b" -n 1 
> b2c871830a03ea5f2fd2b21245afb09d51d69686 in 
> /home/build/jenkins/workspace/ 
> project_user_work 
>at 
> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1012)
>  
>
>at 
> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
>  
>
>at 
> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
>  
>
>

Re: Memory issues with Jenkins

2019-07-09 Thread Sverre Moe

Since we don't use 32bit, the reason must be
- the virtual memory of the OS has been fully depleted

How can I check for this, and remedy it?

fredag 5. juli 2019 03.17.38 UTC+2 skrev Jan Monterrubio følgende:

> Correct me if I’m wrong but I don’t think increasing heap size will 
> actually affect your ability to create more native threads. 
>
> See this for a possible explanation: 
> https://plumbr.io/outofmemoryerror/unable-to-create-new-native-thread
>
> On Thu, Jul 4, 2019 at 16:03 Baptiste Mathus  > wrote:
>
>> Did you enable GC logging to have a better understanding of the profile 
>> of your memory consumption? If not, I would recommend you do it first and 
>> analyze them.
>> https://jenkins.io/blog/2016/11/21/gc-tuning/ explained this part (and 
>> much more) quite well.
>>
>> Then, once you understand better when it crashes, possibly you'll want to 
>> analyze a heap dump to see what is causing the problem.
>>
>> Cheers
>>
>>
>> Le mar. 2 juil. 2019 à 15:30, Sverre Moe > 
>> a écrit :
>>
>>> Today it has been chaotic.
>>> Several build agents disconnected
>>>
>>> Unexpected termination of the channel
>>>
>>> Many builds failed because of Memory error.
>>>
>>> I have tried restarting Jenkins several times today.
>>>
>>> Anyone have any suggestions?
>>>
>>> tirsdag 2. juli 2019 14.34.25 UTC+2 skrev Sverre Moe følgende:

 We have assigned 8GB of memory to our Jenkins instance.
 JAVA_OPTIONS=-Xmx8g

 Still we experience memory issues after a while running.
 java.lang.OutOfMemoryError: unable to create new native thread

 We have:
 aprox 40 connected build agents
 aprox 400 pipeline jobs

 We have a test Jenkins instance running with the same jobs, this one 
 connects to the same build agents (though on a different home directory).

 Lately we have been getting disconnected build agents, that we cannot 
 get up again without restarting Jenkins.

 Can we assign more memory to a build agent? Would it have any affect on 
 this issue?

 This we got from one of our latest Pipeline builds that failed on a 
 sh("find  -exec ***") step. It failed on that build agent that is now 
 disconnected.


 java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at 
 java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
at 
 java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1368)
at java.lang.UNIXProcess.initStreams(UNIXProcess.java:288)
at java.lang.UNIXProcess.lambda$new$2(UNIXProcess.java:258)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.UNIXProcess.(UNIXProcess.java:257)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.(Proc.java:249)
 Also:   java.io.IOException: error=11, Resource temporarily unavailable




 SEVERE: Unexpected error when retrieving changeset 
 hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M 
 "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> % 
 ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b" -n 1 
 b2c871830a03ea5f2fd2b21245afb09d51d69686 in /home/build/jenkins/workspace/ 
 project_user_work 
at 
 org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1012)
  

at 
 org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
  

at 
 org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
  

at hudson.remoting.UserRequest.perform(UserRequest.java:212) 
at hudson.remoting.UserRequest.perform(UserRequest.java:54) 
at hudson.remoting.Request$2.run(Request.java:369) 
at 
 hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
  

at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  

at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  

at java.lang.Thread.run(Thread.java:748)
Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote 
 call to master-sles12.3-x86_64_3 
at 
 hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741) 
at 
 hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
  

 

Re: Memory issues with Jenkins

2019-07-09 Thread Sverre Moe
I will try turning on GC logging.

torsdag 4. juli 2019 23.04.55 UTC+2 skrev Baptiste Mathus følgende:
>
> Did you enable GC logging to have a better understanding of the profile of 
> your memory consumption? If not, I would recommend you do it first and 
> analyze them.
> https://jenkins.io/blog/2016/11/21/gc-tuning/ explained this part (and 
> much more) quite well.
>
> Then, once you understand better when it crashes, possibly you'll want to 
> analyze a heap dump to see what is causing the problem.
>
> Cheers
>
>
> Le mar. 2 juil. 2019 à 15:30, Sverre Moe > 
> a écrit :
>
>> Today it has been chaotic.
>> Several build agents disconnected
>>
>> Unexpected termination of the channel
>>
>> Many builds failed because of Memory error.
>>
>> I have tried restarting Jenkins several times today.
>>
>> Anyone have any suggestions?
>>
>> tirsdag 2. juli 2019 14.34.25 UTC+2 skrev Sverre Moe følgende:
>>>
>>> We have assigned 8GB of memory to our Jenkins instance.
>>> JAVA_OPTIONS=-Xmx8g
>>>
>>> Still we experience memory issues after a while running.
>>> java.lang.OutOfMemoryError: unable to create new native thread
>>>
>>> We have:
>>> aprox 40 connected build agents
>>> aprox 400 pipeline jobs
>>>
>>> We have a test Jenkins instance running with the same jobs, this one 
>>> connects to the same build agents (though on a different home directory).
>>>
>>> Lately we have been getting disconnected build agents, that we cannot 
>>> get up again without restarting Jenkins.
>>>
>>> Can we assign more memory to a build agent? Would it have any affect on 
>>> this issue?
>>>
>>> This we got from one of our latest Pipeline builds that failed on a 
>>> sh("find  -exec ***") step. It failed on that build agent that is now 
>>> disconnected.
>>>
>>>
>>> java.lang.OutOfMemoryError: unable to create new native thread
>>> at java.lang.Thread.start0(Native Method)
>>> at java.lang.Thread.start(Thread.java:714)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:950)
>>> at 
>>> java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1368)
>>> at java.lang.UNIXProcess.initStreams(UNIXProcess.java:288)
>>> at java.lang.UNIXProcess.lambda$new$2(UNIXProcess.java:258)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at java.lang.UNIXProcess.(UNIXProcess.java:257)
>>> at java.lang.ProcessImpl.start(ProcessImpl.java:134)
>>> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
>>> at hudson.Proc$LocalProc.(Proc.java:249)
>>> Also:   java.io.IOException: error=11, Resource temporarily unavailable
>>>
>>>
>>>
>>>
>>> SEVERE: Unexpected error when retrieving changeset 
>>> hudson.plugins.git.GitException: Error: git whatchanged --no-abbrev -M 
>>> "--format=commit %H%ntree %T%nparent %P%nauthor %aN <%aE> % 
>>> ai%ncommitter %cN <%cE> %ci%n%n%w(76,4,4)%s%n%n%b" -n 1 
>>> b2c871830a03ea5f2fd2b21245afb09d51d69686 in /home/build/jenkins/workspace/ 
>>> project_user_work 
>>>at 
>>> org.jenkinsci.plugins.gitclient.CliGitAPIImpl$6.execute(CliGitAPIImpl.java:1012)
>>>  
>>>
>>>at 
>>> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)
>>>  
>>>
>>>at 
>>> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)
>>>  
>>>
>>>at hudson.remoting.UserRequest.perform(UserRequest.java:212) 
>>>at hudson.remoting.UserRequest.perform(UserRequest.java:54) 
>>>at hudson.remoting.Request$2.run(Request.java:369) 
>>>at 
>>> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
>>>  
>>>
>>>at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
>>>at 
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>>  
>>>
>>>at 
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>>  
>>>
>>>at java.lang.Thread.run(Thread.java:748)
>>>Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote 
>>> call to master-sles12.3-x86_64_3 
>>>at 
>>> hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741) 
>>>at 
>>> hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
>>>  
>>>
>>>at hudson.remoting.Channel.call(Channel.java:955) 
>>>at 
>>> org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)
>>>  
>>>
>>>at sun.reflect.GeneratedMethodAccessor678.invoke(Unknown 
>>> Source) 
>>>at 
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>  
>>>
>>>at java.lang.reflect.Method.invoke(Method.java:498) 
>>>at 
>>> org.jenkin

Re: Jenkins Agents getting disconnected

2019-07-09 Thread Sverre Moe
On the build agents that gets disconnected there is plenty of available 
disk space.

When there are trying to connect, there are no remoting.jar java process on 
the agent running.

lørdag 6. juli 2019 22.59.31 UTC+2 skrev Karan Kaushik følgende:
>
> Hi
>
> We had been facing the same issue with Jenkins agent, one thing I remember 
> doing was managing the space on the jenkins agent, the disconnect could 
> happen due to no space remaining on agent machine.
>

-- 
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/22fe9b83-c585-4f1a-8346-471e395ffbce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Declarative Jenkinsfile: different cron trigger per branch

2019-07-09 Thread Amedee Van Gasse
To answer my own question:

#!/usr/bin/env groovy

def schedule = env.BRANCH_NAME.contains('master') ? '@weekly' : env.BRANCH_NAME 
== 'develop' ? '@midnight' : ''

pipeline {


triggers {
cron(schedule)
}


Worked for me.

On Tuesday, July 9, 2019 at 10:34:06 AM UTC+2, Amedee Van Gasse wrote:
>
> I have a *declarative* Jenkinsfile.
> I want to have a daily build of the develop branch.
> I currently have the following trigger:
>
> triggers {
> cron(env.BRANCH_NAME == 'develop' ? '@midnight' : '')
> }
>
> Now I also want to build the master branch. Not daily, but weekly.
> I already know that I can have only one cron expression in triggers.
>
> I know of one solution that works, and that I do not want to use: have a 
> different cron expression committed to each branch.
> I don't want that, because master branches from develop and then gets 
> merged back into develop. Doing it that way, will cause merge conflicts 
> that I don't want to deal with.
>
> The other solution is to have a more complex cron expression in the 
> trigger.
> In pseudo code:
>
> IF (env.BRANCH_NAME = 'develop')
> THEN cron = '@midnight'
> ELSE IF (env.BRANCH_NAME = 'master')
> THEN cron = '@weekly'
>
> I don't know how to construct the correct syntax for the cron expression. 
> Is that Groovy? Linux shell? Something else?
>
> If possible, then I would like to avoid "polluting" my declarative 
> pipeline with script blocks (I don't even know if they are allowed inside 
> triggers).
>

-- 
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/ed96d9c4-e549-41d7-bd5a-2372a1ecfc22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Declarative Jenkinsfile: different cron trigger per branch

2019-07-09 Thread Amedee Van Gasse
I have a *declarative* Jenkinsfile.
I want to have a daily build of the develop branch.
I currently have the following trigger:

triggers {
cron(env.BRANCH_NAME == 'develop' ? '@midnight' : '')
}

Now I also want to build the master branch. Not daily, but weekly.
I already know that I can have only one cron expression in triggers.

I know of one solution that works, and that I do not want to use: have a 
different cron expression committed to each branch.
I don't want that, because master branches from develop and then gets 
merged back into develop. Doing it that way, will cause merge conflicts 
that I don't want to deal with.

The other solution is to have a more complex cron expression in the trigger.
In pseudo code:

IF (env.BRANCH_NAME = 'develop')
THEN cron = '@midnight'
ELSE IF (env.BRANCH_NAME = 'master')
THEN cron = '@weekly'

I don't know how to construct the correct syntax for the cron expression. 
Is that Groovy? Linux shell? Something else?

If possible, then I would like to avoid "polluting" my declarative pipeline 
with script blocks (I don't even know if they are allowed inside triggers).

-- 
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/1e0c46fd-6031-41b9-9cac-1fbb622d9fc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.