Re: Pipeline Multibranch jobs - Build User Vars Plugin

2019-01-21 Thread Carles Capdevila Tejada
Hello Eldad,

We have something like this working on our multibranch pipelines:

hudson.model.Cause.UserIdCause userIdCause = (hudson.model.Cause.UserIdCause
) pipeline.currentBuild.getCause(hudson.model.Cause.UserIdCause.class)

if(userIdCause) {
String userName = userIdCause.getUserName()
String userId = userIdCause.getUserId()
}

Bear in mind that script security may block it when trying to run it.


El lunes, 14 de enero de 2019, 21:33:12 (UTC+1), Eldad Cohen escribió:
>
> Hi,
>
> wrap([$class: 'BuildUser']) {
>   echo "${BUILD_USER}"
>   }
>
> Is it possible with MultiBranch PipeLine ? Got No such property ? 
>
> I just want info what triggered the build ? who did commit ?
>
> 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/2ce06380-9f08-4e62-a795-a51de8a0f75b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to configure the plugin authorize-project with configuration-as-code?

2019-01-21 Thread Guo Zhenyang
Hello,
I'm trying to use configuration-as-code to initial the configuration of the 
Jenkins. Thought it says JCasC "Support most plugins without extra 
development effort" in https://jenkins.io/projects/jcasc/, I can't find a 
list of supported plugins or a demo of configuring plugin 
authorize-project. Can some share with me the information about it?
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/f66aacc5-628e-4e19-ab03-93fb3b6c98fe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to Auto-increment XML tag value in jenkins

2019-01-21 Thread Faad Sayaou
Hi, I have an xml file in my project repo which after checkout, I will like 
to auto increment the last value of the version number for every build. I 
am already accessing the version number using xmlslurper and storing this 
in a variable. I have something like this in my pipeline script and my xml 
file is just a single line script with 1.0.0.0  and I 
will like auto increment the last digit for every build. NB: I do not want 
to use jenkins's build number. That would have been easy by just changing 
the last digit to $BUILD_NUMBER in my project repo. 


  any help please?

@NonCPS

String getVersion(String path) {
def version = new xmlSlurper().parse(new File(path))
return version.toString()
}

node {


stage ('checkout') {
 
 .

   }

   stage ('build) {
   def pwd2=pwd()
   def v=getVersion("${pwd2}/VersionNumber.xml")
 

   sh ' dotnet publish path/to/project -p:Fileversion=$v '

  }
}

-- 
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/a9d3b4a3-b565-471b-9366-c364faed7a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Security Vulnerability

2019-01-21 Thread mohan reddy
SM-7 Missing secure flag on session ID 

In secure HTTPS applications, cookies must have the “Secure” flag set. The 
“Secure” flag informs browsers that a cookie should only be sent on 
connections that are encrypted with SSL. 

Without the “secure” flag, the non-encrypted HTTP domain for the 
application receives same-origin access to cookies set by the secure HTTPS 
domain; browsers will send unencrypted plaintext copies of cookies without 
the “secure” flag. 

Because any attacker on the Internet can fake the non-encrypted HTTP domain 
(it’s the encryption provided by TLS in HTTPS that prevents that from 
happening), and because cookies usually form the core of the authentication 
and authorization model of a web application, failing to set the “Secure” 
flag negates much of the security provided by SSL. 

RECOMMENDATION: Consult framework documentation to set the “Secure” flag on 
the cookie. Setting the “Secure” flag is usually simple; the framework may 
have a configuration setting that ensures all cookies are “Secure”, almost 
always provides a configuration option to ensure the Session cookie is 
“Secure”, and will usually offer the “Secure” flag as an option on the line 
of code that creates any given cookie.

-- 
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/69005922-2061-494c-a246-c9cddd91b640%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Prevent Archiving In a Pipeline

2019-01-21 Thread Ricardo Torres


I have an upstream component, libraryA, I build, archive, and deploy via a 
Maven job, jobA. This works great. I have a downstream Maven job, jobB, 
that has a dependency on libraryA. This also works great, except…

 

I have a completely separate pipeline job, pipelineA specified by 
Jenkinsfile. Within that Jenkinsfile, I build a specific branch of libraryA 
I don’t want archived or deployed. In my Jenkinsfile I have 
“withMaven(mavenLocalRepo: ‘libraryA/.repository’, publisherStrategy: 
‘EXPLICIT’)”, and inside that, “sh “””[…]mvn clean package 
sonar:sonar[…]””” (Any typos here are probably the fault of my typing here 
as I did not copy-paste. There are no errors from Jenkins when executing 
these steps.) I have also tried “options: [artifactsPublisher(disabled: 
true)]” in place of “publisherStrategy: ‘EXPLICIT’” and had the same 
results. I have verified when pipelineA builds libraryA, it does NOT get 
deployed to my remote Maven repository, and I expect it not to get deployed 
there. Good.

 

So, what happens?

 

Well, if I build pipelineA followed by jobB, jobB gets its copy of libraryA 
from pipelineA, causing the build to fail. If I then run jobA, jobB 
succeeds as expected.

 
I could change the version of libraryA in the branch pipelineA builds, but 
I’d rather not do that as it’s not correct for my particular use case. What 
else could I do? What did I miss? (I do not admin this Jenkins instance, so 
my access is limited in that respect.)

-- 
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/103d4eed-cdf3-4716-9029-69365aab5246%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pass the data thru variable using curl command

2019-01-21 Thread David Karr
On Sun, Jan 20, 2019 at 8:55 PM panneerrselvam natarajan 
wrote:

> Hi All,
>
> I am using Jenkins for API Testing in Pega Environment.  I can send and
> receive response thru PostMan and SOAPUI and working fine.
>
> But I want to automate using Jenkins Pipeline.
>
> Please do let me know, How do i send the data/variable thru CURL command
> in pipeline. I sent the data but not displayed any error message and not
> getting any response also
>
> I am sending the data which include special charector along with Data.
> Please do let me know the format.
>

I suggest you show us exactly what you're doing, what the result is, and
what you expected. Exactly.


> Regards
> Panner
>
> --
> 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/ad16f4d1-c745-442a-90df-b2b73b73e03f%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/CAA5t8VpK__XPLyskiSNB_zy-mbqBQL5DNUq2-fsDkjtLJZRTEA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


warnings-ng plug-in in a matrix job

2019-01-21 Thread Braden McDaniel
I have a matrix job that builds on multiple compilers/platforms. One of 
those compilers is clang with static analysis.

I have recently discovered the warnings-ng plug-in; and while it seems 
quite clever, because it operates as a post-build action (and the 
conditional step plug-in does not provide conditional steps in post-build), 
I do not see how to enable it only for the portion of the matrix where 
clang's static analysis is run.

Is there a way to get this sort of result within the matrix job?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/14213f8f-251d-4544-b190-f4c71651a1f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: warnings-ng plug-in in a matrix job

2019-01-21 Thread Ullrich Hafner
Does the plugin fail the job for the other axes? Or can’t you just pick a file 
that is empty for the other axes? 

Currently there is no way to configure different properties for different axes.

> Am 21.01.2019 um 19:49 schrieb Braden McDaniel :
> 
> I have a matrix job that builds on multiple compilers/platforms. One of those 
> compilers is clang with static analysis.
> 
> I have recently discovered the warnings-ng plug-in; and while it seems quite 
> clever, because it operates as a post-build action (and the conditional step 
> plug-in does not provide conditional steps in post-build), I do not see how 
> to enable it only for the portion of the matrix where clang's static analysis 
> is run.
> 
> Is there a way to get this sort of result within the matrix job?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-users+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/14213f8f-251d-4544-b190-f4c71651a1f6%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/034B5AD4-8CD4-4879-B42C-19EC7C7F67B4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pass the data thru variable using curl command

2019-01-21 Thread Panneer
Hi David,

My request is here below:-

def status = "curl -s --max-time 30 POST 'https:url'" -H "Content-type: 
application/json" -d {"DeAppRulesList": 
[{"Applion":"02.01.02","Applime":"REFW"},{"Applion":"01.01.01","Applime":"ATP_Branch"},{"Applion":"01.06.07","Applime":"Temp_FW"}]}'

No error and no response received.

Regards
Panneer


On Monday, January 21, 2019 at 9:50:19 AM UTC-7, David Karr wrote:
>
>
> On Sun, Jan 20, 2019 at 8:55 PM panneerrselvam natarajan <
> pann...@gmail.com > wrote:
>
>> Hi All,
>>
>> I am using Jenkins for API Testing in Pega Environment.  I can send and 
>> receive response thru PostMan and SOAPUI and working fine.
>>
>> But I want to automate using Jenkins Pipeline.
>>
>> Please do let me know, How do i send the data/variable thru CURL command 
>> in pipeline. I sent the data but not displayed any error message and not 
>> getting any response also
>>
>> I am sending the data which include special charector along with Data. 
>> Please do let me know the format.
>>
>
> I suggest you show us exactly what you're doing, what the result is, and 
> what you expected. Exactly.
>
>
>> Regards
>> Panner
>>
>> -- 
>> 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/ad16f4d1-c745-442a-90df-b2b73b73e03f%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/bf8295a7-ebf9-4205-bd36-15a1c762917a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Pass the data thru variable using curl command

2019-01-21 Thread Ramanathan Muthaiah

>
> My request is here below:-
>
> def status = "curl -s --max-time 30 POST 'https:url'" -H "Content-type: 
> application/json" -d {"DeAppRulesList": 
> [{"Applion":"02.01.02","Applime":"REFW"},{"Applion":"01.01.01","Applime":"ATP_Branch"},{"Applion":"01.06.07","Applime":"Temp_FW"}]}'
>
> No error and no response received.
>

Start simple, then expand. Also, I presume you should adjust the cmd, to be 
like, "curl . . . -X POST".

Avoid using "-s" option during the initial trials. man curl is your best 
help.

Remember, getting curl working from CLI and in an automated env like 
Jenkins involves several iterations, depending on the complexity (speaking 
from my personal experience).

/Ram 

-- 
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/40965178-7ef0-4f58-b8d1-9f1ea828108a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.