object Mail_System { def try_open(options: Options): Option[Mail_System] =
Exn.capture(new Mail_System(options)) match { case Exn.Res(res) if res.server.defined => Some(res) case _ => None
}
}
class Mail_System private(options: Options) { val from: Mail.Address = Mail.address(options.string("ci_mail_from")) val to: Mail.Address = Mail.address(options.string("ci_mail_to"))
val server: Mail.Server = new Mail.Server(Mail.address(options.string("ci_mail_sender")),
smtp_host = options.string("ci_mail_smtp_host"),
smtp_port = options.int("ci_mail_smtp_port"),
user = options.string("ci_mail_user"),
password = options.string("ci_mail_password"))
}
val post_result = return_code { job.hook.post(options, url, results, progress) }
val rc = List(mail_result, pre_result, results.rc, post_result).max if (rc != Process_Result.RC.ok) {
progress.echo(section("FAILED"))
if (mail_result != Process_Result.RC.ok) progress.echo("Mail: FAILED") else { val mail_system = Mail_System.try_open(options).get val content = "The job " + job.name + " failed. " + if_proper(url, " View the build at: " + url.get) val mail = Mail("Build failed", List(mail_system.to), content, Some(mail_system.from))
mail_system.server.send(mail)
}
if (pre_result != Process_Result.RC.ok) progress.echo("Pre-hook: FAILED") for (name <- results.sessions) { if (results.cancelled(name)) progress.echo("Session " + name + ": CANCELLED") else { val result = results(name) if (!result.ok) progress.echo("Session " + name + ": FAILED " + result.rc)
}
} if (post_result != Process_Result.RC.ok) progress.echo("Post-hook: FAILED")
}
sys.exit(rc)
}
/* Isabelle tool wrapper */
val isabelle_tool = Isabelle_Tool("build_ci", "builds Isabelle jobs in ci environments",
Scala_Project.here,
{ args => var options = Options.init() val build_hosts = new mutable.ListBuffer[Build_Cluster.Host] var url: Option[Url] = None
val getopts = Getopts("""
Usage: isabelle build_ci [OPTIONS] JOB
Options are:
-H HOSTS host specifications of the form NAMES:PARAMETERS (separated by commas)
-o OPTION override Isabelle system OPTION (via NAME=VAL or NAME)
-u URL build url
Runs Isabelle builds in ci environment. For cluster builds, build hosts must
be passed explicitly (no registry).
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.