author | wenzelm |
Tue, 04 May 2021 20:02:08 +0200 | |
changeset 73625 | f8f065e20837 |
parent 73607 | fc13738e1933 |
child 73629 | a771807df752 |
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 |
||
10 |
object Isabelle_Devel |
|
11 |
{ |
|
65771 | 12 |
val RELEASE_SNAPSHOT = "release_snapshot" |
13 |
val BUILD_LOG_DB = "build_log.db" |
|
14 |
val BUILD_STATUS = "build_status" |
|
67854
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
15 |
val CRONJOB_LOG = "cronjob-main.log" |
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
16 |
|
71601 | 17 |
val root: Path = Path.explode("~/html-data/devel") |
18 |
val cronjob_log: Path = root + Path.basic(CRONJOB_LOG) |
|
65771 | 19 |
|
20 |
||
21 |
/* index */ |
|
22 |
||
73340 | 23 |
def make_index(): Unit = |
65771 | 24 |
{ |
71272
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
25 |
val redirect = "https://isabelle-dev.sketis.net/home/menu/view/20" |
65770 | 26 |
|
65838 | 27 |
HTML.write_document(root, "index.html", |
71272
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
28 |
List( |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
29 |
XML.Elem(Markup("meta", |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
30 |
List("http-equiv" -> "Refresh", "content" -> ("0; url=" + redirect))), Nil)), |
1e7319957408
clarified website: redirect to isabelle-dev Phabricator Overview;
wenzelm
parents:
70105
diff
changeset
|
31 |
List(HTML.link(redirect, HTML.text("Isabelle Development Resources")))) |
65771 | 32 |
} |
65770 | 33 |
|
34 |
||
35 |
/* release snapshot */ |
|
36 |
||
73625
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
37 |
def release_snapshot(options: Options, rev: String, afp_rev: String): Unit = |
65770 | 38 |
{ |
73607
fc13738e1933
clarified command-line, following other build_XYZ tools;
wenzelm
parents:
73340
diff
changeset
|
39 |
Isabelle_System.with_tmp_dir("isadist")(target_dir => |
65770 | 40 |
{ |
65793 | 41 |
Isabelle_System.update_directory(root + Path.explode(RELEASE_SNAPSHOT), |
42 |
website_dir => |
|
73625
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
43 |
{ |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
44 |
val context = Build_Release.Release_Context(target_dir) |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
45 |
val release_archive = Build_Release.build_release_archive(context, rev) |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
46 |
Build_Release.build_release(options, context, release_archive, afp_rev = afp_rev, |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
47 |
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
|
48 |
website = Some(website_dir)) |
f8f065e20837
misc tuning and clarification: more explicit types Release_Context, Release_Archive;
wenzelm
parents:
73607
diff
changeset
|
49 |
}) |
65770 | 50 |
}) |
51 |
} |
|
52 |
||
53 |
||
54 |
/* maintain build_log database */ |
|
55 |
||
73340 | 56 |
def build_log_database(options: Options, log_dirs: List[Path]): Unit = |
65770 | 57 |
{ |
58 |
val store = Build_Log.store(options) |
|
59 |
using(store.open_database())(db => |
|
60 |
{ |
|
66047
3e8a897042d9
more robust: store important meta info before potential failure;
wenzelm
parents:
65854
diff
changeset
|
61 |
store.update_database(db, log_dirs) |
65770 | 62 |
store.update_database(db, log_dirs, ml_statistics = true) |
65771 | 63 |
store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB)) |
65770 | 64 |
}) |
65 |
} |
|
65793 | 66 |
|
67 |
||
68 |
/* present build status */ |
|
69 |
||
73340 | 70 |
def build_status(options: Options): Unit = |
65793 | 71 |
{ |
72 |
Isabelle_System.update_directory(root + Path.explode(BUILD_STATUS), |
|
65854 | 73 |
dir => Build_Status.build_status(options, target_dir = dir, ml_statistics = true)) |
65793 | 74 |
} |
65770 | 75 |
} |