Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-10-08 Thread Corey Wei
Hi Lionel,

It's working once I added the following to Jenkinsfile :
properties([pipelineTriggers([[$class: 'GitHubPushTrigger']])]) 

Thanks

On Thursday, October 6, 2016 at 5:46:52 PM UTC+8, Lionel Orellana wrote:
>
> Hi Corey
>
> Unfortunately I don't have this server running anymore. I was just using 
> it to learn stuff. But I do remember that re-registering hooks worked 
> straight away for me. Are you behind a firewall? I was running this on a 
> cloud provider with direct access from the outside world (e.g. from 
> github.com)  When you say it doesn't work, what error or wrong behavior 
> do you see?
>
> Lionel 
>
> On Thursday, 6 October 2016 16:49:12 UTC+11, Corey Wei wrote:
>>
>> Hi Lionel,
>>
>> I just tested this on Jenkins 2.19.1. 
>> Looks like "Re-register hooks for all jobs" is not working for my 
>> multibranch job. Is there anything I am missing?
>>
>> Thanks
>>
>> On Monday, May 9, 2016 at 9:08:52 PM UTC+8, Lionel Orellana wrote:
>>>
>>>
>>> Apologies for my rather disorganised thought process in this thread.  
>>>
>>> I just found the 'Re-register hooks for all jobs' in the global config 
>>> (GitHub Servers Advanced options). That created the hooks correctly for me 
>>> without any additional configuration in the multibranch job. 
>>>
>>> Thanks.
>>>
>>> On Saturday, 7 May 2016 16:38:49 UTC+10, Lionel Orellana wrote:
>>>>
>>>> Well seems like the solution would for the GitHub Plugin to support 
>>>> Multibranch pipelines
>>>>
>>>> On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>>>>>
>>>>> Hi All
>>>>>
>>>>> How can I trigger a build on a multibranch pipeline where there is a 
>>>>> push in github and Jenkins requires authentication.
>>>>>
>>>>> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
>>>>> generated here isn't enough for a github webhook to authenticate with 
>>>>> Jenkins.  Github throws "Authentication required". This is using  a 
>>>>> webhook like /job//build?token=some token  where 
>>>>> the token matches what's in the "Trigger builds remotely" configuration.
>>>>>
>>>>> Thanks
>>>>>
>>>>> Lionel.
>>>>>
>>>>>  
>>>>>
>>>>

-- 
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/b9cf3400-2e42-491a-94d7-646375e11636%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Secure Jenkins and mutlibranch github pipeline trigger

2016-10-05 Thread Corey Wei
Hi Lionel,

I just tested this on Jenkins 2.19.1. 
Looks like "Re-register hooks for all jobs" is not working for my 
multibranch job. Is there anything I am missing?

Thanks

On Monday, May 9, 2016 at 9:08:52 PM UTC+8, Lionel Orellana wrote:
>
>
> Apologies for my rather disorganised thought process in this thread.  
>
> I just found the 'Re-register hooks for all jobs' in the global config 
> (GitHub Servers Advanced options). That created the hooks correctly for me 
> without any additional configuration in the multibranch job. 
>
> Thanks.
>
> On Saturday, 7 May 2016 16:38:49 UTC+10, Lionel Orellana wrote:
>>
>> Well seems like the solution would for the GitHub Plugin to support 
>> Multibranch pipelines
>>
>> On Saturday, 7 May 2016 12:29:22 UTC+10, Lionel Orellana wrote:
>>>
>>> Hi All
>>>
>>> How can I trigger a build on a multibranch pipeline where there is a 
>>> push in github and Jenkins requires authentication.
>>>
>>> I tried "Trigger builds remotely (e.g., from scripts)" but the token 
>>> generated here isn't enough for a github webhook to authenticate with 
>>> Jenkins.  Github throws "Authentication required". This is using  a 
>>> webhook like /job//build?token=some token  where 
>>> the token matches what's in the "Trigger builds remotely" configuration.
>>>
>>> Thanks
>>>
>>> Lionel.
>>>
>>>  
>>>
>>

-- 
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/7d523677-1684-4d78-8c54-94c8ff5659d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't download plugins - HTTP 302 redirect

2016-09-22 Thread Corey Wei
Thanks Daniel & Baptiste. It's working fine.
Does it have any plan to support http to https redirect?

On Thursday, September 22, 2016 at 10:02:08 AM UTC+8, Daniel Beck wrote:
>
> Turns out this was https://issues.jenkins-ci.org/browse/JENKINS-38340 and 
> we removed the mirror from the list, as its admins don't want to serve 
> files via HTTP. 
>
> > On 19.09.2016, at 20:56, Baptiste Mathus <m...@batmat.net > 
> wrote: 
> > 
> > I think it's https://issues.jenkins-ci.org/browse/JENKINS-8028 but 
> surprised it's still active. Pretty sure I saw fixes about this. Maybe it 
> was on some other parts like Tools. 
> > 
> > 2016-09-19 6:10 GMT+02:00 Corey Wei <core...@gmail.com >: 
> > anyone can help? 
> > 
> > 
> > On Sunday, September 18, 2016 at 4:43:12 PM UTC+8, Corey Wei wrote: 
> > Hi Croy, 
> > 
> > I just downloaded a hpi from the mirror and the file's good. 
> > 
> > The problem is that Jenkins server doesn't  follow 302 redirects to 
> download the correct file but always downloads a "302 redirect" response 
> file. 
> > 
> > # a 302 redirect file 
> > $ cat git-server.jpi.tmp 
> >  
> >  
> > 302 Found 
> >  
> > Found 
> > The document has moved https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi;>here.
>  
>
> >  
> > 
> > # file can be downloaded  correctly via wget 
> > $ wget -v 
> http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi 
> > --2016-09-18 15:49:54--  
> http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi 
> > Resolving updates.jenkins-ci.org... 52.202.51.185 
> > Connecting to updates.jenkins-ci.org|52.202.51.185|:80... connected. 
> > HTTP request sent, awaiting response... 302 Found 
> > Location: 
> http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi 
> [following] 
> > --2016-09-18 15:49:55--  
> http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi 
> > Resolving mirrors.jenkins-ci.org... 52.202.51.185 
> > Reusing existing connection to updates.jenkins-ci.org:80. 
> > HTTP request sent, awaiting response... 302 Found 
> > Location: 
> https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
>  
> [following] 
> > --2016-09-18 15:49:58--  
> https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
>  
> > Resolving mirrors.tuna.tsinghua.edu.cn... 166.111.206.63, 
> 2402:f000:1:416:166:111:206:63 
> > Connecting to mirrors.tuna.tsinghua.edu.cn|166.111.206.63|:443... 
> connected. 
> > HTTP request sent, awaiting response... 200 OK 
> > Length: 40729 (40K) [application/octet-stream] 
> > Saving to: “git-server.hpi.1” 
> > 
> > 
> 100%[===>]
>  
> 40,729  --.-K/s   in 0s 
> > 
> > 
> > 2016-09-18 15:49:58 (188 MB/s) - “git-server.hpi.1” saved [40729/40729] 
> > 
> > 
> > 
> > On Sunday, September 18, 2016 at 2:59:06 PM UTC+8, R Tyler Croy wrote: 
> > (replies inline) 
> > 
> > On Sat, 17 Sep 2016, Corey Wei wrote: 
> > 
> > > Hi, 
> > > 
> > > My Jenkins 2.22 is working with Tomcat. There are some errors while I 
> tried 
> > > to install plugins like this: 
> > > 
> > > 18-Sep-2016 11:17:05.590 SEVERE [Update center installer thread [#1]] 
> > > hudson.model.UpdateCenter$DownloadJob.run Failed to install GIT server 
> > > Plugin 
> > >  java.io.IOException: Downloaded file 
> > > /home/deploy/.jenkins2/plugins/git-server.jpi.tmp does not match 
> expected 
> > > SHA-1, expected 'LoG8X55ycVzgPjwTtCA/iKb7lvw=', actual 
> > > 'Lbk3pB/mu/UlYJO4o2ttQkZ+mvs=' 
> > 
> > 
> > I recently added a mirror located in China 
> > (https://issues.jenkins-ci.org/browse/INFRA-924). 
> > 
> > Would you mind downloading some files and comparing between the mirror 
> you're 
> > hitting and: http://ftp-nyc.osuosl.org/pub/jenkins/ 
> > 
> > 
> > If that mirror is serving corrupted artifacts I will remove it from the 
> > rotation immediately. 
> > 
> > 
> > 
> > > at 
> hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799) 
> > > at 
> hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147) 
> > > at 
> > > 
> hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950) 
> > > at 
> > > 

Re: Can't download plugins - HTTP 302 redirect

2016-09-18 Thread Corey Wei
anyone can help?

On Sunday, September 18, 2016 at 4:43:12 PM UTC+8, Corey Wei wrote:
>
> Hi Croy,
>
> I just downloaded a hpi from the mirror and the file's good.
>
> The problem is that Jenkins server doesn't  follow 302 redirects to 
> download the correct file but always downloads a "302 redirect" response 
> file.
>
> # a 302 redirect file
> $ cat git-server.jpi.tmp
> 
> 
> 302 Found
> 
> Found
> The document has moved https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
> ">here.
> 
>
> # file can be downloaded  correctly via wget
> $ wget -v 
> http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi
> --2016-09-18 15:49:54--  
> http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi
> Resolving updates.jenkins-ci.org... 52.202.51.185
> Connecting to updates.jenkins-ci.org|52.202.51.185|:80... connected.
> HTTP request sent, awaiting response... 302 Found
> Location: 
> http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi 
> [following]
> --2016-09-18 15:49:55--  
> http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi
> Resolving mirrors.jenkins-ci.org... 52.202.51.185
> Reusing existing connection to updates.jenkins-ci.org:80.
> HTTP request sent, awaiting response... 302 Found
> Location: 
> https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
>  
> [following]
> --2016-09-18 15:49:58--  
> https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
> Resolving mirrors.tuna.tsinghua.edu.cn... 166.111.206.63, 
> 2402:f000:1:416:166:111:206:63
> Connecting to mirrors.tuna.tsinghua.edu.cn|166.111.206.63|:443... 
> connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 40729 (40K) [application/octet-stream]
> Saving to: “git-server.hpi.1”
>
> 100%[===>]
>  
> 40,729  --.-K/s   in 0s
>
>
> 2016-09-18 15:49:58 (188 MB/s) - “git-server.hpi.1” saved [40729/40729]
>
>
>
> On Sunday, September 18, 2016 at 2:59:06 PM UTC+8, R Tyler Croy wrote:
>>
>> (replies inline) 
>>
>> On Sat, 17 Sep 2016, Corey Wei wrote: 
>>
>> > Hi, 
>> > 
>> > My Jenkins 2.22 is working with Tomcat. There are some errors while I 
>> tried 
>> > to install plugins like this: 
>> > 
>> > 18-Sep-2016 11:17:05.590 SEVERE [Update center installer thread [#1]] 
>> > hudson.model.UpdateCenter$DownloadJob.run Failed to install GIT server 
>> > Plugin 
>> >  java.io.IOException: Downloaded file 
>> > /home/deploy/.jenkins2/plugins/git-server.jpi.tmp does not match 
>> expected 
>> > SHA-1, expected 'LoG8X55ycVzgPjwTtCA/iKb7lvw=', actual 
>> > 'Lbk3pB/mu/UlYJO4o2ttQkZ+mvs=' 
>>
>>
>> I recently added a mirror located in China 
>> (https://issues.jenkins-ci.org/browse/INFRA-924). 
>>
>> Would you mind downloading some files and comparing between the mirror 
>> you're 
>> hitting and: http://ftp-nyc.osuosl.org/pub/jenkins/ 
>>
>>
>> If that mirror is serving corrupted artifacts I will remove it from the 
>> rotation immediately. 
>>
>>
>>
>> > at 
>> hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799) 
>> > at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147) 
>> > at 
>> > 
>> hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950) 
>> > at 
>> > 
>> hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1194)
>>  
>>
>> > at 
>> > hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1669) 
>> > at 
>> > hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864) 
>> > at 
>> hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640) 
>> > at 
>> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
>> > at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
>> > at 
>> > 
>> hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
>>  
>>
>> > at java.lang.Thread.run(Thread.java:745) 
>> > 
>> > $ cat ~/.jenkins2/plugins/git-server.jpi.tmp 
>> >  
>> >  
>> > 302 Found 
>> >  
>> > Found 
>> > The document has moved > > href="
>> ht

Re: Can't download plugins - HTTP 302 redirect

2016-09-18 Thread Corey Wei
Hi Croy,

I just downloaded a hpi from the mirror and the file's good.

The problem is that Jenkins server doesn't  follow 302 redirects to 
download the correct file but always downloads a "302 redirect" response 
file.

# a 302 redirect file
$ cat git-server.jpi.tmp


302 Found

Found
The document has moved https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi;>here.


# file can be downloaded  correctly via wget
$ wget -v 
http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi
--2016-09-18 15:49:54-- 
 http://updates.jenkins-ci.org/download/plugins/git-server/1.7/git-server.hpi
Resolving updates.jenkins-ci.org... 52.202.51.185
Connecting to updates.jenkins-ci.org|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: 
http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi 
[following]
--2016-09-18 15:49:55-- 
 http://mirrors.jenkins-ci.org/plugins/git-server/1.7/git-server.hpi
Resolving mirrors.jenkins-ci.org... 52.202.51.185
Reusing existing connection to updates.jenkins-ci.org:80.
HTTP request sent, awaiting response... 302 Found
Location: 
https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
 
[following]
--2016-09-18 15:49:58-- 
 
https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi
Resolving mirrors.tuna.tsinghua.edu.cn... 166.111.206.63, 
2402:f000:1:416:166:111:206:63
Connecting to mirrors.tuna.tsinghua.edu.cn|166.111.206.63|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40729 (40K) [application/octet-stream]
Saving to: “git-server.hpi.1”

100%[===>]
 
40,729  --.-K/s   in 0s


2016-09-18 15:49:58 (188 MB/s) - “git-server.hpi.1” saved [40729/40729]



On Sunday, September 18, 2016 at 2:59:06 PM UTC+8, R Tyler Croy wrote:
>
> (replies inline) 
>
> On Sat, 17 Sep 2016, Corey Wei wrote: 
>
> > Hi, 
> > 
> > My Jenkins 2.22 is working with Tomcat. There are some errors while I 
> tried 
> > to install plugins like this: 
> > 
> > 18-Sep-2016 11:17:05.590 SEVERE [Update center installer thread [#1]] 
> > hudson.model.UpdateCenter$DownloadJob.run Failed to install GIT server 
> > Plugin 
> >  java.io.IOException: Downloaded file 
> > /home/deploy/.jenkins2/plugins/git-server.jpi.tmp does not match 
> expected 
> > SHA-1, expected 'LoG8X55ycVzgPjwTtCA/iKb7lvw=', actual 
> > 'Lbk3pB/mu/UlYJO4o2ttQkZ+mvs=' 
>
>
> I recently added a mirror located in China 
> (https://issues.jenkins-ci.org/browse/INFRA-924). 
>
> Would you mind downloading some files and comparing between the mirror 
> you're 
> hitting and: http://ftp-nyc.osuosl.org/pub/jenkins/ 
>
>
> If that mirror is serving corrupted artifacts I will remove it from the 
> rotation immediately. 
>
>
>
> > at 
> hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799) 
> > at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147) 
> > at 
> > 
> hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950) 
> > at 
> > 
> hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1194)
>  
>
> > at 
> > hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1669) 
> > at 
> > hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864) 
> > at 
> hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640) 
> > at 
> > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
> > at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> > at 
> > 
> hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
>  
>
> > at java.lang.Thread.run(Thread.java:745) 
> > 
> > $ cat ~/.jenkins2/plugins/git-server.jpi.tmp 
> >  
> >  
> > 302 Found 
> >  
> > Found 
> > The document has moved  > href="
> https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi;>here.
>  
>
> >  
> > 
> > Looks like it redirects to a mirror update center. 
> > 
> > Any comments would be 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-use...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci

Can't download plugins - HTTP 302 redirect

2016-09-17 Thread Corey Wei
Hi,

My Jenkins 2.22 is working with Tomcat. There are some errors while I tried 
to install plugins like this:

18-Sep-2016 11:17:05.590 SEVERE [Update center installer thread [#1]] 
hudson.model.UpdateCenter$DownloadJob.run Failed to install GIT server 
Plugin
 java.io.IOException: Downloaded file 
/home/deploy/.jenkins2/plugins/git-server.jpi.tmp does not match expected 
SHA-1, expected 'LoG8X55ycVzgPjwTtCA/iKb7lvw=', actual 
'Lbk3pB/mu/UlYJO4o2ttQkZ+mvs='
at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1799)
at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147)
at 
hudson.model.UpdateCenter$InstallationJob.replace(UpdateCenter.java:1950)
at 
hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1194)
at 
hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1669)
at 
hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:1864)
at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1640)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at 
hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
at java.lang.Thread.run(Thread.java:745)

$ cat ~/.jenkins2/plugins/git-server.jpi.tmp


302 Found

Found
The document has moved https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/git-server/1.7/git-server.hpi;>here.


Looks like it redirects to a mirror update center.

Any comments would be 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/f1aca3c2-9edb-4c41-addb-042bbb5bae85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.