Re: Need Github pull request number as environment variable

2017-07-18 Thread Paper Arts Calif
It doesn't. :-( Not in the latest version of the plugin.

On Tuesday, May 30, 2017 at 6:46:35 AM UTC-7, Arvind Jayaprakash wrote:
>
> The environment variable CHANGE_ID contains the PR number
>
> On Friday, May 26, 2017 at 6:07:20 AM UTC+5:30, Cody Ebberson wrote:
>>
>> Hello,
>>
>> I'm configuring Github + Jenkins + Sonar.  Almost everything is working, 
>> and I am incredibly pleased (great job!)  I'm now struggling with one 
>> missing piece which seems like it should be simple.
>>
>> The last piece I need is the Github pull request *number* as an 
>> environment variable to pass to Sonar for "preview" mode analysis.
>>
>> Here are the relevant components and versions:
>>
>> Jenkins version 2.46.3
>> Jenkins "GitHub Branch Source Plugin" version 2.0.5
>> Maven version 3.3.9
>> Maven Sonar plugin version 3.3.0.603
>> Sonar version  6.3.1.21392
>> Sonar Github plugin version 1.4.1
>>
>> Per https://stackoverflow.com/a/32095346 it looks like the old "GitHub 
>> Pull Request Builder" plugin added a ${ghprbPullId} environment variable. 
>>  That environment variable is not set by the "GitHub Branch Source Plugin" 
>> (as far as I can tell).
>>
>> A dump of "env" does not show anything about pull requests, change ID's, 
>> etc.  The known pull request number is not anywhere in the logs.
>>
>> Suggestions?
>>
>> If this isn't available through Jenkins, I think we could do some curl + 
>> Github API magic to search for the Pull Request number, but that obviously 
>> seems suboptimal.
>>
>> Thanks in advance!
>>
>> Cody
>>
>>

-- 
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/202c9cd6-f995-41b4-9509-69124ac0fefd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need Github pull request number as environment variable

2017-05-30 Thread Arvind Jayaprakash
The environment variable CHANGE_ID contains the PR number

On Friday, May 26, 2017 at 6:07:20 AM UTC+5:30, Cody Ebberson wrote:
>
> Hello,
>
> I'm configuring Github + Jenkins + Sonar.  Almost everything is working, 
> and I am incredibly pleased (great job!)  I'm now struggling with one 
> missing piece which seems like it should be simple.
>
> The last piece I need is the Github pull request *number* as an 
> environment variable to pass to Sonar for "preview" mode analysis.
>
> Here are the relevant components and versions:
>
> Jenkins version 2.46.3
> Jenkins "GitHub Branch Source Plugin" version 2.0.5
> Maven version 3.3.9
> Maven Sonar plugin version 3.3.0.603
> Sonar version  6.3.1.21392
> Sonar Github plugin version 1.4.1
>
> Per https://stackoverflow.com/a/32095346 it looks like the old "GitHub 
> Pull Request Builder" plugin added a ${ghprbPullId} environment variable. 
>  That environment variable is not set by the "GitHub Branch Source Plugin" 
> (as far as I can tell).
>
> A dump of "env" does not show anything about pull requests, change ID's, 
> etc.  The known pull request number is not anywhere in the logs.
>
> Suggestions?
>
> If this isn't available through Jenkins, I think we could do some curl + 
> Github API magic to search for the Pull Request number, but that obviously 
> seems suboptimal.
>
> Thanks in advance!
>
> Cody
>
>

-- 
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/f9ef0661-d59a-47f4-a8f8-b734493edadc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need Github pull request number as environment variable

2017-05-28 Thread Joshua Noble
If you use the GitHub branch source plugin, the pull request number will show 
up in the $BRANCH variable. I suggest using this plugin as it will 
automatically create jobs and build every branch and PR.

-- 
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/f9e47282-1bac-427f-985e-4ab225d5cc29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Need Github pull request number as environment variable

2017-05-26 Thread Cody Ebberson
I went ahead with a script to search for the Pull Request number.  Here is 
the script in case anyone might find it useful:
https://gist.github.com/codyebberson/16be8a5eb796a444ab69bfded7f64324

-- 
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/3410c32c-1f7a-42e1-844a-416343231d11%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Need Github pull request number as environment variable

2017-05-25 Thread Cody Ebberson
Hello,

I'm configuring Github + Jenkins + Sonar.  Almost everything is working, 
and I am incredibly pleased (great job!)  I'm now struggling with one 
missing piece which seems like it should be simple.

The last piece I need is the Github pull request *number* as an environment 
variable to pass to Sonar for "preview" mode analysis.

Here are the relevant components and versions:

Jenkins version 2.46.3
Jenkins "GitHub Branch Source Plugin" version 2.0.5
Maven version 3.3.9
Maven Sonar plugin version 3.3.0.603
Sonar version  6.3.1.21392
Sonar Github plugin version 1.4.1

Per https://stackoverflow.com/a/32095346 it looks like the old "GitHub Pull 
Request Builder" plugin added a ${ghprbPullId} environment variable.  That 
environment variable is not set by the "GitHub Branch Source Plugin" (as 
far as I can tell).

A dump of "env" does not show anything about pull requests, change ID's, 
etc.  The known pull request number is not anywhere in the logs.

Suggestions?

If this isn't available through Jenkins, I think we could do some curl + 
Github API magic to search for the Pull Request number, but that obviously 
seems suboptimal.

Thanks in advance!

Cody

-- 
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/4669eb11-556f-45b3-8a0f-9ebbbceaea76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.