How to get logged in username of Jenkins in parameter's Groovy script?

2020-06-10 Thread Gajanan Mahajan
In Jenkins parameter, I'm writing Groovy script and in that script I need 
to pass Jenkins logged in username NOT user. User and username, could be 
different

Ex - User, that is displayed left to 'log out', could be - Bob Gill and 
username, used to login - could be - bob

User can be retrieved using `User.current()`. Please tell me how to get 
username.

**NOTE** I don't need username in pipeline code. I need it in Groovy script 
of parameter.

-- 
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/ffcb606c-8ff4-4574-8b04-0e51a88cb201o%40googlegroups.com.


Amazon EC2: Getting Access Denied trying to use Windows DPAPI

2020-06-10 Thread Carel Combrink
Hi,

We are using an AWS EC2 Windows AMI to do our builds from a Jenkins job
using the ec2-plugin.
Our libraries use the Windows Cryptography API: Next Generation (NG)
(DPAPI) to protect sensitive data from C# and C++ components.

Our builds succeed without any issue, but our unit test trying to use this
API in the AMI instance keeps on failing. On the C# side we get the
following exception (almost the same on C++ side):

Access is denied.
Source: System.Security
HRESULT: -2147024891
Stack:
   at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData,
Byte[] optionalEntropy, DataProtectionScope scope)

We could get the Unit Tests passing with PsExec, but the output is lost and
the step that normally takes about 20 minutes now takes more than 4 hours.

>From some reading up it seems like the WinRM connection is the cause of the
issue, the PsExec seems to verify that.

Is there a way to configure or set up the AMI + plugin to allow us to use
the DPAPI inside the AMI for the unit tests (Without having to use an
external tool like PsExec)?

Regards,
Carel

-- 
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/CAAxNqap8gEXPhzZq9f7gnTUyX1Whv0FezYg%3DKBPL0BKDL5ReLg%40mail.gmail.com.


set build name according to build status

2020-06-10 Thread maple.feng.w...@hotmail.com
Hi,

I met a problem about set build name according to build status in Jenkins.

My configuration is quite simple,

- set build name "Deploying on xxx ..." in build environment
- set build name "Deploy on xxx successfully" in conditional steps(current 
build status, worst: success, best: success) in build section
- set build name "Deploy on xxx failed" in conditional steps(current build 
status, worst: failure, best: failure)

But the result is not expected:
```

[Current build status] check if current [SUCCESS] is worse or equals then 
[SUCCESS] and better or equals then [SUCCESS]Run condition [Current build 
status] enabling perform for step [BuilderChain]
New run name is '#9 - Deploy on 192.168.13.8 successfully'
Variable with name 'BUILD_DISPLAY_NAME' already exists, current value: '#9 - 
Deploying on 192.168.13.8 ...', new value: '#9 - Deploy on 192.168.13.8 
successfully'
[Current build status] check if current [SUCCESS] is worse or equals then 
[FAILURE] and better or equals then [FAILURE]Run condition [Current build 
status] preventing perform for step [BuilderChain]
New run name is '#9 - Deploying on 192.168.13.8 ...'
Variable with name 'BUILD_DISPLAY_NAME' already exists, current value: '#9 - 
Deploy on 192.168.13.8 successfully', new value: '#9 - Deploying on 
192.168.13.8 ...'

```

The plugin set the right name at build according to success result, but 
somehow it's renamed back, I don't know why it happen. Anyone know how to 
configure to achieve what I want? thanks

best regards.

-- 
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/b3471d5b-06da-496d-912e-d10c9c35b846o%40googlegroups.com.


Jira Trigger Issue with Jenkins plugin

2020-06-10 Thread Vignesh Sundar
We tried to trigger a job in jenkins using jira webhooks when we make 
changes on jira issue tickets. We are using the below jenkin plugins to 
configure with Jira.
We can successfully configure it with jira using the below plugins 
separately. I created a job to trigger based on my jira issue update and 
create.

   - Atlassian Jira Software Cloud 
    *Supported 
   by Atlassian*
   - JIRA Trigger  *Not supported 
   by Atlassian*
   - JIRA site  *Not supported by 
   Atlassian*

But unable to build a job when I make any update on my jira issue. Can any 
one please help me to resolve this issue

-- 
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/4ce17d78-a6b7-467d-b457-82f523044c36o%40googlegroups.com.


set build name according to build status

2020-06-10 Thread maple.feng.w...@hotmail.com
Hi,

I met a problem when I tried to set build name according to build status in 
Jenkins.

My requirement is quite simple, when build is in progress, the build name 
is "Depolying xxx on xxx ...", when the build succeed, then set build name 
as "Deploy xxx on xxx successfully", when the build fails, then set build 
name as "Deploy xxx on xxx failed".

My configuration is quite clear:

set build name "Depolying xxx on xxx ..." in build environment

set build name "Deploy xxx on xxx successfully" in conditional step(Current 
Build Status, Worst status: SUCCESS, Best status: SUCCESS) in build section 

set build name "Deploy xxx on xxx failed" in conditional step(Current Build 
Status, Worst status: Failure, Best status: Failure) in build section


But the result is not what I expect, here is log for build successfully:
 
```

[Current build status] check if current [SUCCESS] is worse or equals then 
[SUCCESS] and better or equals then [SUCCESS]Run condition [Current build 
status] enabling perform for step [BuilderChain]
New run name is '#9 - Deploy on 192.168.13.8 successfully'Variable with name 
'BUILD_DISPLAY_NAME' already exists, current value: '#9 - Deploying on 
192.168.13.8 ...', new value: '#9 - Deploy on 192.168.13.8 successfully'
[Current build status] check if current [SUCCESS] is worse or equals then 
[FAILURE] and better or equals then [FAILURE]Run condition [Current build 
status] preventing perform for step [BuilderChain]
New run name is '#9 - Deploying on 192.168.13.8 ...'Variable with name 
'BUILD_DISPLAY_NAME' already exists, current value: '#9 - Deploy on 
192.168.13.8 successfully', new value: '#9 - Deploying on 192.168.13.8 ...'

```

The plugin detected the status and change the name as expected at first, 
but somehow, it's renamed back. I don't know why it happened, how should I 
configure to archive what I expect? thanks.

best regards.

-- 
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/3ddedd8c-292c-4ad0-9e1f-88e180190e88o%40googlegroups.com.


Vagrant Provision Error

2020-06-10 Thread kathir
> Hi
>>
>> I have kept my vagrant file and script file in git
>>
>> I have used vagrant & virtual box plugin
>>
>> but still I am not able to boot or provision VM
>>
>> Also I got following error
>>
>> [vagrantcentosubuntu] $ vagrant -v
>> Vagrant 2.2.9
>> [ vagrant ]: Executing command :[vagrant, provision, Centos7, 
>> --provision-with, Centos7/script.sh] in folder 
>> /var/lib/jenkins/workspace/vagrantcentosubuntu/Centos7
>> [Centos7] $ vagrant provision Centos7 --provision-with Centos7/script.sh
>> The machine with the name 'Centos7' was not found configured for
>> this Vagrant environment.
>> Build step 'Provision a Vagrant VM' marked build as failure
>> Finished: FAILURE
>>
>>
>> Thanks & Regards,
>> Kathirvel G
>>
>

-- 
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/CADArzrtWsVk4DwjFfKcht67kG8kftfEOpBsyARCiub1xKa0fkQ%40mail.gmail.com.