# HG changeset patch # User wenzelm # Date 1476473702 -7200 # Node ID 123e6dcd3852487b74adfe894a44d264d9cb42af # Parent 284e8ca54c211c9d254ddce8ab27a4536d4b7595 cronjob: build release from repository snapshot; diff -r 284e8ca54c21 -r 123e6dcd3852 src/Pure/Admin/isabelle_cronjob.scala --- a/src/Pure/Admin/isabelle_cronjob.scala Fri Oct 14 21:34:52 2016 +0200 +++ b/src/Pure/Admin/isabelle_cronjob.scala Fri Oct 14 21:35:02 2016 +0200 @@ -22,6 +22,8 @@ val isabelle_repos = main_dir + Path.explode("isabelle-build_history") val afp_repos = main_dir + Path.explode("AFP-build_history") + val release_snapshot = main_dir + Path.explode("release_snapshot") + /** particular tasks **/ @@ -59,6 +61,29 @@ }) + /* build release from repository snapshot */ + + private val build_release = + Logger_Task("build_release", logger => + Isabelle_System.with_tmp_dir("isadist")(tmp_dir => + { + val base_dir = File.path(tmp_dir) + + val new_snapshot = release_snapshot.ext("new") + val old_snapshot = release_snapshot.ext("old") + + Isabelle_System.rm_tree(new_snapshot) + Isabelle_System.rm_tree(old_snapshot) + + Build_Release.build_release(base_dir, parallel_jobs = 4, + remote_mac = "macbroy30", website = Some(new_snapshot)) + + if (release_snapshot.is_dir) File.mv(release_snapshot, old_snapshot) + File.mv(new_snapshot, release_snapshot) + Isabelle_System.rm_tree(old_snapshot) + })) + + /** task logging **/ @@ -191,7 +216,7 @@ run(main_start_date, Logger_Task("isabelle_cronjob", _ => - run_now(SEQ(isabelle_identify, build_history_base)))) + run_now(SEQ(isabelle_identify, build_history_base, build_release)))) log_service.shutdown()