我需要一种方法让 Jenkins 在收到电子邮件时执行操作。我计划发送一封带有 Ruby 脚本和 net/smtp 的电子邮件。
2 回答
I'm also not aware of a plugin for Jenkins to start jobs via email. However, it is easy to use a service like CloudMailin (which converts the incoming email to an HTTP POST) and use a small script of your own to make this interact with the Jenkins API and schedule jobs.
I've done this personally and it works pretty well. I didn't make full use of the API and just used the following URL:
http://SERVER_URL/job/JOB_NAME/build?delay=60
You don't need the delay but I found it useful to ask multiple jobs to be set at the same time.
有一个插件可以让你通过电子邮件向 Jenkins 发送命令。没有亲自使用过,但这里是:
https ://wiki.jenkins-ci.org/display/JENKINS/Mail+Commander+Plugin