Jenkins is useful for monitoring the non-interactive execution of processes, such as cron jobs, procmail, inetd-launched processes. Often those tasks are completely unmonitored (which makes it hard for you to notice when things go wrong), or they send e-mails constantly regardless of the success or failure (which results into the same situation as you’ll quickly start ignoring them anyway.) Using Jenkins enables you to monitor a large number of such tasks with little overhead. Jenkins用于监视非交互式执行的进程,例如cron、procmail、inetd-launched启动的进程。通常,这些任务是完全不受监控的 (这使得你很难注意到什么时候出了问题),例如他们不停地发送电子邮件,而不管成功与否(这会导致同样的情况,然后你会很快就会开始忽略这些邮件)。 使用Jenkins可以让你以很少的开销监控大量这样的任务。
<html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 403 No valid crumb was included in the request</title> </head> <body><h2>HTTP ERROR 403</h2> <p>Problem accessing /jenkins/job/test_external/postBuildResult. Reason: <pre> No valid crumb was included in the request</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.5.v20170502</a><hr/>
The JENKINS_HOME variable is used to locate the server Jenkins is running, so this must be set. 这个 JENKINS_HOME 的环境变量是定位你的jenkins的,必须设置成你的jenkins的url地址, 如果需要账号密码, 你的url地址中可以带上 username:password@ 这个。
<run> <log encoding="hexBinary">...hex binary encoded console output...</log> <result>... integer indicating the error code. 0 is success and everything else is failure</result> <duration>... milliseconds it took to execute this run ...</duration> <displayName>... The name to be displayed rather than the build number ...</displayName> <description>... Description of the build ...</description> </run>
https://github.com/mamh-java/external-monitor-job-plugin/blob/master/src/main/java/hudson/cli/SetExternalBuildResultCommand.java @Extension public class SetExternalBuildResultCommand extends CLICommand {
@Option(name="--job", aliases={"-j"}, metaVar="JOB", usage="Name of the external monitor job", required=true) public transient TopLevelItem job;
@Option(name="--display", aliases={"-n"}, metaVar="DISPLAY", usage="Display name of the build", required=false) public transient String displayName;
@Option(name="--result", aliases={"-r"}, metaVar="RESULT", usage="0: success, 1: fail", required=false) public transient int result = 0;
@Option(name="--duration", aliases={"-d"}, metaVar="DURATION", usage="Number of milli-seconds it took to run this build", required=false) public transient long duration = 0;
@Option(name="--log", aliases={"-l"}, metaVar="-|LOG", usage="Log to be set. '-' to read from stdin (gzipped).", required=true) public String log;
@Option(name="--dump-build-number", aliases={"-b"}, usage="Log the produced build number to the standard output", required=false) public boolean dumpBuildNumber;