Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WEBHOOK 가 작동하지 않는 것같습니다. #103

Closed
SongPaul opened this issue Dec 8, 2016 · 15 comments
Closed

WEBHOOK 가 작동하지 않는 것같습니다. #103

SongPaul opened this issue Dec 8, 2016 · 15 comments

Comments

@SongPaul
Copy link

SongPaul commented Dec 8, 2016

젠킨슨에서 웹후크를 작동하도록 주소와 토큰을 넣었는데
실행되지 않는것 같습니다.

설정이나 작동확인 하는 방법을 알 수 있을 까요. ?

JENKINS_URL/job/SCORECARD/build?token=TOKEN_NAME

@doortts
Copy link
Collaborator

doortts commented Dec 8, 2016

@SongPaul 안녕하세요?
서버간 네트워크 연결이 되는지, hook url이 정확한지 확인해 보시면 좋을 것 같습니다.
요나를 설치한 서버에서 wget 이나 curl 등의 명령어로 웹훅 url을 직접 실행해봐주시겠어요?

대략 이런식이 될 것 같습니다.

curl -I JENKINS_URL/job/SCORECARD/build?token=TOKEN_NAME

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 회신주셔서 감사합니다.

curl 이나 wget 으로는 정상적으로 후크를 보내주네요..

요나 웹후크
주소 http://id:pass@url/job/DEV-SAR/build?token=
토큰 token_name

이렇게 설정하였습니다.
ㅠㅠ;

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul curl로도 젠킨스가 정상 실행되는건 확인하신거죠?

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 넵 wget / curl 둘다 날렸을때 젠킨스 도 실행됩니다 ㅠ

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul 아! 그럼

curl -X POST -I http://id:pass@url/job/DEV-SAR/build?token=

이렇게도 한 번 해봐주시겠어요?

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 알려주신 커맨드로는 젠킨스가 동작하지 않네요ㅠ

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul Jenkins에서 job trigger를 POST로 지정해 주셔야 할것 같습니다.

Yona (구 Yobi) webhook은 Github Webhook 과 의도적으로 유사하게 만들어져 있습니다.

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 젠킨스에 해당 설정부분이 없는 것같은데, 어디서 확인해야 될까요. ? ㅠ

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API 를 사용하고 계신거죠?

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 이거 사용하고 있는데 같은거같내요
dev-sar config jenkins

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul

curl -X POST -I http://id:pass@url/job/DEV-SAR/build?token=

이 경우 응답코드가 어떻게 되세요?

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 아래와 같이 나옵니다.

HTTP/1.1 403 No valid crumb was included in the request
Date: Fri, 09 Dec 2016 06:33:35 GMT
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=ISO-8859-1
Cache-Control: must-revalidate,no-cache,no-store
Content-Length: 367
Server: Jetty(9.2.z-SNAPSHOT)

@doortts
Copy link
Collaborator

doortts commented Dec 9, 2016

@SongPaul 우선 http://stackoverflow.com/questions/28577551/how-to-disable-a-jenkins-job-via-curl 에서 관련 내용 확인해봐 주시겠어요? 밤에 좀 더 살펴볼게요.;;

@SongPaul
Copy link
Author

SongPaul commented Dec 9, 2016

@doortts 감사합니다. 알려주신 링크에서 답을 찾았네요
CSRF 보안 으로인해 블럭당한 거네요;;'

setup jenkins's "global security settings": Uncheck "Prevent Cross Site Request Forgery exploits"

위처럼 체크 해제 하니 정상으로 후크를 받습니다.
감사합니다.

@SongPaul SongPaul closed this as completed Dec 9, 2016
@pokev25
Copy link
Collaborator

pokev25 commented Dec 12, 2016

아..이런 내용도 위키에 들어가면 좋겠네요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants