src/Pure/Admin/isabelle_cronjob.scala
changeset 65770 fb8a7962f2ae
parent 65768 b8da621a3297
child 65771 688a7dd22cbb
     1.1 --- a/src/Pure/Admin/isabelle_cronjob.scala	Mon May 08 11:33:04 2017 +0200
     1.2 +++ b/src/Pure/Admin/isabelle_cronjob.scala	Mon May 08 12:04:58 2017 +0200
     1.3 @@ -28,11 +28,6 @@
     1.4    val isabelle_release_source = "http://bitbucket.org/isabelle_project/isabelle-release"
     1.5    val afp_source = "https://bitbucket.org/isa-afp/afp-devel"
     1.6  
     1.7 -  val devel_dir = Path.explode("~/html-data/devel")
     1.8 -  val release_snapshot_dir = devel_dir + Path.explode("release_snapshot")
     1.9 -  val build_log_db = devel_dir + Path.explode("build_log.db")
    1.10 -  val build_status_dir = devel_dir + Path.explode("build_status")
    1.11 -
    1.12    val jenkins_jobs = "identify" :: Jenkins.build_log_jobs
    1.13  
    1.14  
    1.15 @@ -43,7 +38,6 @@
    1.16  
    1.17    private val build_release =
    1.18      Logger_Task("build_release", logger =>
    1.19 -      Isabelle_System.with_tmp_dir("isadist")(base_dir =>
    1.20          {
    1.21            val rev = Mercurial.repository(isabelle_repos).id()
    1.22            val afp_rev = Mercurial.setup_repository(afp_source, afp_repos).id()
    1.23 @@ -51,19 +45,9 @@
    1.24            File.write(logger.log_dir + Build_Log.log_filename("isabelle_identify", logger.start_date),
    1.25              Build_Log.Identify.content(logger.start_date, Some(rev), Some(afp_rev)))
    1.26  
    1.27 -          val new_snapshot = release_snapshot_dir.ext("new")
    1.28 -          val old_snapshot = release_snapshot_dir.ext("old")
    1.29 -
    1.30 -          Isabelle_System.rm_tree(new_snapshot)
    1.31 -          Isabelle_System.rm_tree(old_snapshot)
    1.32 -
    1.33 -          Build_Release.build_release(base_dir, rev = rev, afp_rev = afp_rev,
    1.34 -            parallel_jobs = 4, remote_mac = "macbroy31", website = Some(new_snapshot))
    1.35 -
    1.36 -          if (release_snapshot_dir.is_dir) File.move(release_snapshot_dir, old_snapshot)
    1.37 -          File.move(new_snapshot, release_snapshot_dir)
    1.38 -          Isabelle_System.rm_tree(old_snapshot)
    1.39 -        }))
    1.40 +          Isabelle_Devel.release_snapshot(rev = rev, afp_rev = afp_rev,
    1.41 +            parallel_jobs = 4, remote_mac = "macbroy31")
    1.42 +        })
    1.43  
    1.44  
    1.45    /* integrity test of build_history vs. build_history_base */
    1.46 @@ -175,33 +159,9 @@
    1.47        })
    1.48    }
    1.49  
    1.50 -
    1.51 -  /* maintain build_log database */
    1.52 -
    1.53 -  val database_dirs =
    1.54 -    List(Path.explode("~/log"), Path.explode("~/afp/log"), Path.explode("~/cronjob/log"))
    1.55 -
    1.56 -  def database_update(options: Options)
    1.57 -  {
    1.58 -    val store = Build_Log.store(options)
    1.59 -    using(store.open_database())(db =>
    1.60 -    {
    1.61 -      store.update_database(db, database_dirs, ml_statistics = true)
    1.62 -      store.snapshot_database(db, build_log_db)
    1.63 -    })
    1.64 -  }
    1.65 -
    1.66 -
    1.67 -  /* present build status */
    1.68 -
    1.69    val build_status_profiles: List[Build_Status.Profile] =
    1.70      (remote_builds_old :: remote_builds).flatten.map(_.profile)
    1.71  
    1.72 -  def build_status(options: Options)
    1.73 -  {
    1.74 -    Build_Status.present_data(Build_Status.read_data(options), target_dir = build_status_dir)
    1.75 -  }
    1.76 -
    1.77  
    1.78  
    1.79    /** task logging **/
    1.80 @@ -349,8 +309,10 @@
    1.81            SEQ(List(build_release, build_history_base,
    1.82              PAR(remote_builds.map(seq => SEQ(seq.map(remote_build_history(rev, _))))),
    1.83              Logger_Task("jenkins_logs", _ => Jenkins.download_logs(jenkins_jobs, main_dir)),
    1.84 -            Logger_Task("build_log_database", logger => database_update(logger.options)),
    1.85 -            Logger_Task("build_status", logger => build_status(logger.options)))))))
    1.86 +            Logger_Task("build_log_database",
    1.87 +              logger => Isabelle_Devel.build_log_database(logger.options)),
    1.88 +            Logger_Task("build_status",
    1.89 +              logger => Isabelle_Devel.build_status(logger.options)))))))
    1.90  
    1.91      log_service.shutdown()
    1.92