unable to configure poll mailbox plugin to trigger build through email

2019-03-11 Thread Archana Srichandan
Error while testing connection is:

Connecting to the mailbox...
Error : javax.mail.MessagingException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target;
  nested exception is:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find
valid certification path to requested target
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:665)
at javax.mail.Service.connect(Service.java:295)
at javax.mail.Service.connect(Service.java:176)
at
org.jenkinsci.plugins.pollmailboxtrigger.mail.MailReader.connect(MailReader.java:58)
at
org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger.checkForEmails(PollMailboxTrigger.java:238)
at
org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger$PollMailboxTriggerDescriptor.doTestConnection(PollMailboxTrigger.java:584)
at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627)
at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
at
org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:145)
at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:537)
at
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
at
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:282)
at
org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
Regards,
Archana Srichandan

-- 
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/CA%2BU8sbWqeOjQyGth%2BFC-81fUKhVS54SEty9xp1i2Q7FrwMH78g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Declarative Pipeline: Lock multiple stages using NODE_NAME as resource.

2019-03-11 Thread Dusan Nikolov
Hi, what do you mean configure the plugin? 

If you're referring to adding lockable resources, that's not necessary -  
if a resource doesn't exist it will be created on the fly (which I already 
confirmed).
The problem I'm having is described in this thread 
exactly: https://issues.jenkins-ci.org/browse/JENKINS-43336

On Monday, March 11, 2019 at 5:58:00 AM UTC-7, Mark Lübbehüsen wrote:
>
> Hi,
>
> after downloading the Lockable Resource Plugin in Jenkins, you have to 
> configure it in the system configuration of jenkins.
>
>
>
> Am Freitag, 8. März 2019 00:58:59 UTC+1 schrieb Dusan Nikolov:
>>
>> Hi, I'm trying to lock multiple stages in a pipeline and would like to 
>> use NODE_NAME as the resource. Purpose is to allow multiple parallel 
>> executions of the pipeline on different available nodes, but to make a node 
>> unavailable while it's used by one running pipeline instance.
>> Now, the trick is that pipeline needs to be setup to run on two nodes at 
>> the same time (please see example below).
>> I've tried setting it up by using lock in options block of the 
>> surrounding stage, but since options gets evaluated/executed before agent 
>> is assigned to a stage, this fails to find NODE_NAME.
>>
>> pipeline {
>> agent none
>> stages {
>> stage ('main') {
>> parallel {
>> stage ('server') {
>> agent { label 'server' }
>> options { lock("${NODE_NAME}")} // This doesn't work. NODE_NAME not 
>> available
>> steps {
>> script {
>> echo "${NODE_NAME}"
>> sleep(10)
>> }
>> }
>> }
>> stage ('client') {
>> agent { label 'client' }
>> options { lock("${NODE_NAME}")} // This doesn't work. NODE_NAME not 
>> available
>> steps {
>> script {
>> echo "${NODE_NAME}"
>> sleep(10)
>> }
>> }
>> }
>> }
>> }
>> }
>> }
>>
>>

-- 
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/67e3c848-aa2f-4a92-9551-d4def5a93fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins Pipeline: Variable expansion issues

2019-03-11 Thread Mike Craig
Hello,

The following snippet from my pipeline is acting very strangely, the values 
from the print statements are correct

  print "asgName: $asgName"
 print "asgMax: $asgMax"
 print "asgMin: $asgMin"
 asgIncrease = (asgMax * 2)
 print "Setting ASG size to ${asgIncrease}"
 sh ("aws autoscaling update-auto-scaling-group --min-size ${
asgMin} --max-size ${asgMax} --region ${region} --auto-scaling-group-name ${
asgName} ")


output

*15:27:13*  ecs_service_name: lab-us-west-2-lab-rat[Pipeline] sh 
*15:27:14*
  + aws autoscaling describe-auto-scaling-groups --region us-west-2*15:27:14*  
+ jq .AutoScalingGroupName*15:27:14*  + jq '.AutoScalingGroups[]'*15:27:14*  + 
jq 'select (.AutoScalingGroupName | contains ("lab-us-west-2-lab-rat"))'
>
> [Pipeline] sh 
> *15:27:18*
>   + aws autoscaling describe-auto-scaling-groups --region us-west-2*15:27:18* 
>  + jq 'select (.AutoScalingGroupName | contains 
> ("lab-us-west-2-lab-rat"))'*15:27:18*  + jq .MaxSize*15:27:18*  + jq 
> '.AutoScalingGroups[]'
>
> [Pipeline] sh 
> 
>
> *15:27:22*  + jq 'select (.AutoScalingGroupName | contains 
> ("lab-us-west-2-lab-rat"))'*15:27:22*  + jq .MinSize*15:27:22*  + jq 
> '.AutoScalingGroups[]'*15:27:22*  + aws autoscaling 
> describe-auto-scaling-groups --region us-west-2
>
> [Pipeline] echo 
> *15:27:26*
>   asgName: "lab-us-west-2-lab-rat-serviceInstanceAutoscalingGroup"*15:27:26*  
> [Pipeline] echo 
> *15:27:26*
>   asgMax: 1*15:27:26*  [Pipeline] echo 
> *15:27:26*
>   asgMin: 1*15:27:26*  [Pipeline] echo 
> *15:27:26*
>   Setting ASG size to 1*15:27:26*  1*15:27:26*  [Pipeline] sh 
> *15:27:26*
>   + aws autoscaling update-auto-scaling-group --min-size 1
>
> *15:27:27*  usage: aws [options]   [ ...] 
> [parameters]*15:27:27*  To see help text, you can run:*15:27:27*  *15:27:27*  
>   aws help*15:27:27*aws  help*15:27:27*aws  
>  help*15:27:27*  aws: error: argument --auto-scaling-group-name 
> is required
>
>
*2 things here, *
1. the asgIncrease variable should evaluate to 2, as I'm doubling the 
original variable.  
2 The line where the "aws autoscaling" command is executed does not expand 
and execute the entire line. I have tried hardcoding values here, and that 
seems to work, but how to use variables??


What am I doing wrong?

Thank you!



 

-- 
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/f6560954-54e3-4afd-a8cf-f76bd9de11c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Publish grails 3 app/plugin with Jenkins

2019-03-11 Thread Joud Kassem
Hi,

Anyone knows or has a guide to how to publish grails 3 plugin or app using 
jenkins?

Thanks in advance

-- 
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/dac0b1ec-6f01-4181-80d2-ac2e123788ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


custom tool installation on jenkins slave through pipeline

2019-03-11 Thread vinikumar . 123
Hello ,

how to install a custom tool on multiple jenkins slaves through a pipeline 
(Jenkinsfile)

-- 
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/a99ce88b-87c4-45d8-a942-816aaf2b5d41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: sending email for unstable builds

2019-03-11 Thread Mark Lübbehüsen
Hi,

its better you send emails in the post action

post {
  always {
   
}
success {
}
unstable {


}
failure {
   
}
aborted {
}
}

https://jenkins.io/doc/pipeline/tour/post/


Am Donnerstag, 28. Februar 2019 21:41:50 UTC+1 schrieb Faad Sayaou:
>
> Hi everyone
> I am using the extended email plugin for notification when the build fails 
> by using try catch. I will also like to send email when the build is 
> unstable. Below is the structure of my pipeline 
>
> node {
>
>try 
>{
>  
> stage('Checkout') {
> cleanWs()
> checkout scm
>
> }
>
>
> stage('Restore') {
>
> sh "dotnet restore  $proj"
>
>}
>
> stage('Build') {
> sh "dotnet restore  $proj"
>
>}
> stage ('Unit test') {
>
>sh "dotnet test  $test"
>} 
>}
> } catch (err) {
>  emailext body: 
> ' ${JOB_NAME} ${BUILD_NUMBER} is failing! Somebody should do 
> something about that. https://jenkins-ma.com/job/Test/${BUILD_NUMBER}/console 
> ',
>  subject: 'FAILURE', to: 'someEmail..'
> }
>
>
> I will like to send not only when the pipeline fails but when the build is 
> unstable. 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/e3a993c8-7263-40f7-a421-6effb374611e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins Declarative Pipeline: Lock multiple stages using NODE_NAME as resource.

2019-03-11 Thread Mark Lübbehüsen
Hi,

after downloading the Lockable Resource Plugin in Jenkins, you have to 
configure it in the system configuration of jenkins.



Am Freitag, 8. März 2019 00:58:59 UTC+1 schrieb Dusan Nikolov:
>
> Hi, I'm trying to lock multiple stages in a pipeline and would like to use 
> NODE_NAME as the resource. Purpose is to allow multiple parallel executions 
> of the pipeline on different available nodes, but to make a node 
> unavailable while it's used by one running pipeline instance.
> Now, the trick is that pipeline needs to be setup to run on two nodes at 
> the same time (please see example below).
> I've tried setting it up by using lock in options block of the surrounding 
> stage, but since options gets evaluated/executed before agent is assigned 
> to a stage, this fails to find NODE_NAME.
>
> pipeline {
> agent none
> stages {
> stage ('main') {
> parallel {
> stage ('server') {
> agent { label 'server' }
> options { lock("${NODE_NAME}")} // This doesn't work. NODE_NAME not 
> available
> steps {
> script {
> echo "${NODE_NAME}"
> sleep(10)
> }
> }
> }
> stage ('client') {
> agent { label 'client' }
> options { lock("${NODE_NAME}")} // This doesn't work. NODE_NAME not 
> available
> steps {
> script {
> echo "${NODE_NAME}"
> sleep(10)
> }
> }
> }
> }
> }
> }
> }
>
>

-- 
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/b44aa8ae-43e1-4e6e-907b-2a6efddbc3e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Jenkins with reviewbot plugin

2019-03-11 Thread shridevi Bellatti
Hi,
I am using Jenkins pipeline script with reviewbot plugin.

My pipeline job is parameterized with 'Reviewboard url'. when i access this 
in the pipeline script, it is NULL always. how do i get the updated value.

properties([
parameters([
[
$class: 'ReviewboardParameterDefinition'
]
])
])
node('cloud') {
 stage ('Build'){
echo "${params.review.url}"
}

}

Any help is really appreciated. 
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/4c0d04bf-7207-4703-a710-feded90c179a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


All view issue in jenkins

2019-03-11 Thread Archana Srichandan
Hi Team,

while creating different user i want only subjected job should be view to
the developer but ,all view is available,

any way we can only keep view as per the required login user.

Example:developer should view only development jobs, no testing ,no QA ,no
default view ..only development jobs
Regards,
Archana Srichandan

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


Is unit testing possible for classes using plugins

2019-03-11 Thread Kaliyug Antagonist


This class, to begin with, will have a generic, public httpRequest method:

/**
 * Provides Jenkins functionality required by the other utility classes.
 */
//Info: This class helps to reduce the Jenkins plug-in specific code clutter in 
the utility classes.
// All the Jenkins-specific code should be present in this(and more, if 
required) classes.
final class JenkinsUtil {

private def script

public JenkinsUtil(def script) {
this.script = script
}

/**
 *
 * @param link
 * @param parameters Refer the httpRequest plug-in https://jenkins.io/doc/pipeline/steps/http_request/;>documentation 
for acceptable parameters.
 * @return
 */
public def initiateHttpRequest(String link, Map parameters) 
{

//Remove
script.println "Link: ${link}, parameters: ${parameters}"

String validationErrorMessage = 
validateHttpRequestParameters(parameters)

if(validationErrorMessage != null && !validationErrorMessage.isEmpty()){
script.println "Validation error in httpRequest 
${validationErrorMessage}"
return validationErrorMessage
}

String parametersString = 
getAppendedParametersForHttpRequest(parameters)

script.httpRequest url: link,
parametersString
}

private String validateHttpRequestParameters(Mapparameters){

if(parameters == null || parameters.isEmpty()){
return "Parameters for the httpRequest cannot be null/empty."
}

//TODO:If the parameters contain anything other than the keys mentioned 
in the official documentation, return

//TODO:If the values for any of the parameter keys deviate from what 
the acceptable values as per the official documentation are, return
}

private String getAppendedParametersForHttpRequest(Map 
parameters){

StringBuffer parametersSb = new StringBuffer()

parameters.each{
key, value -> parametersSb << key+":"+value+","
}

parametersSb.deleteCharAt(parametersSb.length()-1)

//Remove
script.println "parameters are ${parametersSb.toString()}"
return parametersSb.toString()
}
}

Suppose, I try to write a unit test for the above class:

import spock.lang.Specification

class JenkinsUtilTest extends Specification {

def "InitiateHttpRequest"() {

given:
JenkinsUtil jenkinsUtil = new JenkinsUtil(/*How to create a script 
instance*/)
String url = "https://ci.prod-jenkins.com/cjoc/;
Mapparameters = new  HashMap<>()
parameters.put("ignoreSslErrors",true)

when:
def response = jenkinsUtil.initiateHttpRequest(url,parameters)

then:
response.contains("401")
}
}

}
}

Questions:

   1. How do I create a script instance to pass to the JenkinsUtil(Maybe, a 
   Expando or Script instance)
   2. Is there a way(say, by including some Jenkins dependencies in 
   build.gradle) to simulate the 'script.httpRequest' call i.e simulate the 
   Jenkins httpRequest plugin
   3. Is it correct to even think of unit-testing such a class
   4. Is it correct to even think of creating such a class
   

-- 
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/04b3f980-b59a-4b8a-86cd-7b55cf54ccea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


how can i get release notes through jenkins with proper versioning

2019-03-11 Thread Archana Srichandan
Hi Team,

Need a suggestion for release notes though Jenkins with proper versioning
can be set up through Jenkins?

Regards,
Archana Srichandan

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


Re: Adding java libraries to jenkins

2019-03-11 Thread Baptiste Mathus
Not sure I understand the use case to be honest.

Care to add details?



Le dim. 10 mars 2019 à 15:12, Peter Berghold  a
écrit :

> How would I go about adding java libraries to jenkins?  I may not be
> voicing what I'm trying to do very well so I'll go into a little detail.
>
> I'd like to set up a library of beans such as one reflective of the
> contents of a list of s3 files with the creation date, size and filename as
> a structure.
>
> Is this even possible?
>
> --
>
> Peter L. Berghold   salty.cowd...@gmail.com
>
> http://devops.berghold.net
>
>
> --
> 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/CAArvnv3DcvcDrOSCiwA8PHJJHKR4RSX2EKMA0qoOyt41h98aDw%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/CANWgJS4fvxRvbC%2BHvyURg%2B_k0tH5532rDXcdEymXt2WSdZ-afg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ticketing tool which better get integrated with jenkins

2019-03-11 Thread RAJENDRA PRASAD
Jira

On Mon, 11 Mar, 2019, 11:29 Archana Srichandan, <
archana.srichan...@4tigo.com> wrote:

> Hi Team,
> Any suggestion on ticketing tool which goes well with Jenkins and is
> reliable and under budget with good convenient  features
> Regards,
> Archana Srichandan
>
> --
> 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/CA%2BU8sbWgv3KhgfC5EFpAYCHNK20sZcf4a4eUtd%2B%3DV-s0OHDtbg%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/CAMrg02RtaXa2zOhBcB%3DzOqj1LCfgzH_E3SDzTXH8kGPcST5LWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.