author | wenzelm |
Fri, 01 Apr 2022 17:06:10 +0200 | |
changeset 75393 | 87ebf5a50283 |
parent 74857 | 25e9e7088561 |
child 75394 | 42267c650205 |
permissions | -rw-r--r-- |
65770 | 1 |
/* Title: Pure/Admin/isabelle_devel.scala |
2 |
Author: Makarius |
|
3 |
||
4 |
Website for Isabelle development resources. |
|
5 |
*/ |
|
6 |
||
7 |
package isabelle |
|
8 |
||
9 |
||
75393 | 10 |
object Isabelle_Devel { |
65771 | 11 |
val RELEASE_SNAPSHOT = "release_snapshot" |
12 |
val BUILD_LOG_DB = "build_log.db" |
|
13 |
val BUILD_STATUS = "build_status" |
|
67854
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
14 |
val CRONJOB_LOG = "cronjob-main.log" |
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
15 |
|
71601 | 16 |
val root: Path = Path.explode("~/html-data/devel") |
17 |
val cronjob_log: Path = root + Path.basic(CRONJOB_LOG) |
|
65771 | 18 |
|
19 |
||
20 |
/* index */ |
|
21 |
||
75393 | 22 |
def make_index(): Unit = { |
71272
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
23 |
val redirect = "https://isabelle-dev.sketis.net/home/menu/view/20" |
65770 | 24 |
|
65838 | 25 |
HTML.write_document(root, "index.html", |
71272
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
26 |
List( |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
27 |
XML.Elem(Markup("meta", |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
28 |
List("http-equiv" -> "Refresh", "content" -> ("0; url=" + redirect))), Nil)), |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
29 |
List(HTML.link(redirect, HTML.text("Isabelle Development Resources")))) |
65771 | 30 |
} |
65770 | 31 |
|
32 |
||
33 |
/* release snapshot */ |
|
34 |
||
75393 | 35 |
def release_snapshot(options: Options, rev: String, afp_rev: String): Unit = { |
36 |
Isabelle_System.with_tmp_dir("isadist")(target_dir => { |
|
65793 | 37 |
Isabelle_System.update_directory(root + Path.explode(RELEASE_SNAPSHOT), |
75393 | 38 |
website_dir => { |
73625
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
39 |
val context = Build_Release.Release_Context(target_dir) |
73629 | 40 |
Build_Release.build_release_archive(context, rev) |
41 |
Build_Release.build_release(options, context, afp_rev = afp_rev, |
|
73625
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
42 |
build_sessions = List(Isabelle_System.getenv("ISABELLE_LOGIC")), |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
43 |
website = Some(website_dir)) |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
44 |
}) |
65770 | 45 |
}) |
46 |
} |
|
47 |
||
48 |
||
49 |
/* maintain build_log database */ |
|
50 |
||
75393 | 51 |
def build_log_database(options: Options, log_dirs: List[Path]): Unit = { |
65770 | 52 |
val store = Build_Log.store(options) |
75393 | 53 |
using(store.open_database())(db => { |
66047
3e8a897042d9
more robust: store important meta info before potential failure;
wenzelm
parents:
65854
diff
changeset
|
54 |
store.update_database(db, log_dirs) |
65770 | 55 |
store.update_database(db, log_dirs, ml_statistics = true) |
65771 | 56 |
store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB)) |
65770 | 57 |
}) |
58 |
} |
|
65793 | 59 |
|
60 |
||
61 |
/* present build status */ |
|
62 |
||
75393 | 63 |
def build_status(options: Options): Unit = { |
65793 | 64 |
Isabelle_System.update_directory(root + Path.explode(BUILD_STATUS), |
65854 | 65 |
dir => Build_Status.build_status(options, target_dir = dir, ml_statistics = true)) |
65793 | 66 |
} |
65770 | 67 |
} |