author | wenzelm |
Sun, 20 May 2018 11:57:17 +0200 | |
changeset 68224 | 1f7308050349 |
parent 67854 | 8374c80165e1 |
child 68229 | 18c36ac0acaa |
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 |
|
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
17 |
val root = Path.explode("~/html-data/devel") |
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
18 |
val cronjob_log = root + Path.basic(CRONJOB_LOG) |
65771 | 19 |
|
20 |
||
21 |
/* index */ |
|
22 |
||
23 |
def make_index() |
|
24 |
{ |
|
25 |
val header = "Isabelle Development Resources" |
|
65770 | 26 |
|
65838 | 27 |
HTML.write_document(root, "index.html", |
28 |
List(HTML.title(header)), |
|
29 |
List(HTML.chapter(header), |
|
30 |
HTML.itemize( |
|
31 |
List( |
|
32 |
HTML.text("Isabelle nightly ") ::: |
|
33 |
List(HTML.link(RELEASE_SNAPSHOT, HTML.text("release snapshot"))) ::: |
|
34 |
HTML.text(" (for all platforms)"), |
|
65770 | 35 |
|
65838 | 36 |
HTML.text("Isabelle ") ::: |
37 |
List(HTML.link(BUILD_STATUS + "/index.html", HTML.text("build status"))) ::: |
|
38 |
HTML.text(" information"), |
|
65771 | 39 |
|
65838 | 40 |
HTML.text("Database with recent ") ::: |
41 |
List(HTML.link(BUILD_LOG_DB, HTML.text("build log"))) ::: |
|
42 |
HTML.text(" information (e.g. for ") ::: |
|
68224 | 43 |
List(HTML.link("https://sqlitebrowser.org", |
65838 | 44 |
List(HTML.code(HTML.text("sqlitebrowser"))))) ::: |
67854
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
45 |
HTML.text(")"), |
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
46 |
|
8374c80165e1
publish current log file, e.g. for easy error detection;
wenzelm
parents:
66896
diff
changeset
|
47 |
HTML.text("Cronjob ") ::: List(HTML.link(CRONJOB_LOG, HTML.text("log file"))))))) |
65771 | 48 |
} |
65770 | 49 |
|
50 |
||
51 |
/* release snapshot */ |
|
52 |
||
53 |
def release_snapshot( |
|
54 |
rev: String = "", |
|
55 |
afp_rev: String = "", |
|
56 |
parallel_jobs: Int = 1, |
|
57 |
remote_mac: String = "") |
|
58 |
{ |
|
59 |
Isabelle_System.with_tmp_dir("isadist")(base_dir => |
|
60 |
{ |
|
65793 | 61 |
Isabelle_System.update_directory(root + Path.explode(RELEASE_SNAPSHOT), |
62 |
website_dir => |
|
63 |
Build_Release.build_release(base_dir, rev = rev, afp_rev = afp_rev, |
|
64 |
parallel_jobs = parallel_jobs, remote_mac = remote_mac, website = Some(website_dir))) |
|
65770 | 65 |
}) |
66 |
} |
|
67 |
||
68 |
||
69 |
/* maintain build_log database */ |
|
70 |
||
66896 | 71 |
def build_log_database(options: Options, log_dirs: List[Path]) |
65770 | 72 |
{ |
73 |
val store = Build_Log.store(options) |
|
74 |
using(store.open_database())(db => |
|
75 |
{ |
|
66047
3e8a897042d9
more robust: store important meta info before potential failure;
wenzelm
parents:
65854
diff
changeset
|
76 |
store.update_database(db, log_dirs) |
65770 | 77 |
store.update_database(db, log_dirs, ml_statistics = true) |
65771 | 78 |
store.snapshot_database(db, root + Path.explode(BUILD_LOG_DB)) |
65770 | 79 |
}) |
80 |
} |
|
65793 | 81 |
|
82 |
||
83 |
/* present build status */ |
|
84 |
||
85 |
def build_status(options: Options) |
|
86 |
{ |
|
87 |
Isabelle_System.update_directory(root + Path.explode(BUILD_STATUS), |
|
65854 | 88 |
dir => Build_Status.build_status(options, target_dir = dir, ml_statistics = true)) |
65793 | 89 |
} |
65770 | 90 |
} |