Triggering jenkins build over ssh?

倾然丶 夕夏残阳落幕 提交于 2021-02-19 04:50:26

问题


I'm trying to trigger a Jenkins build from a USS (unix on z/os) git repository. The jenkins server is running in tomcat on my local windows machine.

Most examples on the web describe a solution like this: http://www.andyfrench.info/2015/03/automatically-triggering-jenkins-build.html

and I managed to get that working on my home pc from a local windows-based git repo to my locally running jenkins server.

Basically, this involves creating a post-commit hook and invoking a special Jenkins git endpoint via cURL. The only issue is, my organization did not install cURL on USS, so we have to do everything over ssh.

Is there a way to create a post-commit hook script on a USS system that invokes a jenkins build on windows without using cURL (likely ssh)?

My setup is: git on z/os (commit) -> trigger jenkins pipeline (on windows) -> which does some stuff to build, populate various repos on


回答1:


Another option would be talk to your sysprogs, and ask them to install the Rocket Software ported tools suite, which includes cURL.




回答2:


The Durable-Task-Plugin was recently updated to fix issues with SSH and encoding. This should help:

https://wiki.jenkins.io/display/JENKINS/Durable+Task+Plugin

Changelog Version 1.29 (Jan 31, 2019)
Enhancement: Add support for z/OS Unix System Services to the sh step. (JENKINS-37341)




回答3:


It depends on your Windows.

The latest Windows 10 (1803+), for instance, comes with an OpenSSH server (beta feature) that you can activate.

For earlier version of Windows, you would need to install an openSSH server to listen to your hook SSH call.




回答4:


And a third option would be to use telnet to invoke the web hook, as documented here: How to make an HTTP GET request manually with netcat?



来源:https://stackoverflow.com/questions/54878321/triggering-jenkins-build-over-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!