Check-in [36ecf1972e]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:HTML: Export all of the jail metadata through bset()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 36ecf1972eb468c0e2ad2c40b8999dc64a399151
User & Date: bdrewery 2013-05-28 12:52:55
Context
2013-05-28
15:00
jail -sk: Validate ports tree exists check-in: 942024c4c4 user: bdrewery tags: trunk
12:52
HTML: Export all of the jail metadata through bset() check-in: 36ecf1972e user: bdrewery tags: trunk
12:43
Track and display SVN URL@REV in HTML check-in: 739c59e4b5 user: bdrewery tags: trunk
Changes

Changes to src/share/poudriere/awk/json.awk.

1
2
3
4
5
6
7










8
9
10
11
12
13
14
..
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Parse the .poudriere files created during build into a JSON format
# that the web interface can fetch and use with jQuery. See
# common.sh build_json() for how it is used

function group_type(type) {
  if (type == "svn_url")
    return "string"










  if (type == "builders")
    return "array"
  if (type == "status")
    return "array"
  return "object"
}

................................................................................
    in_type = type
  }
}
BEGIN {
  ORS=""
  in_type=""
  print "{\n"
  print "\"setname\": \"" setname "\","
  print "\"ptname\": \"" ptname "\","
  print "\"jail\": \"" jail "\","
  print "\"buildname\": \"" buildname "\","
}
{
  file_parts_count = split(FILENAME, file_parts, "/")
  filename = file_parts[file_parts_count]
  # Skip builders as status already contains enough information
  if (filename == ".poudriere.builders" || FILENAME ~ /\.swp/)
    next







>
>
>
>
>
>
>
>
>
>







 







<
<
<
<







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
91
92
93
94
95
96
97




98
99
100
101
102
103
104
# Parse the .poudriere files created during build into a JSON format
# that the web interface can fetch and use with jQuery. See
# common.sh build_json() for how it is used

function group_type(type) {
  if (type == "svn_url")
    return "string"
  if (type == "setname")
    return "string"
  if (type == "ptname")
    return "string"
  if (type == "jailname")
    return "string"
  if (type == "buildname")
    return "string"
  if (type == "mastername")
    return "string"
  if (type == "builders")
    return "array"
  if (type == "status")
    return "array"
  return "object"
}

................................................................................
    in_type = type
  }
}
BEGIN {
  ORS=""
  in_type=""
  print "{\n"




}
{
  file_parts_count = split(FILENAME, file_parts, "/")
  filename = file_parts[file_parts_count]
  # Skip builders as status already contains enough information
  if (filename == ".poudriere.builders" || FILENAME ~ /\.swp/)
    next

Changes to src/share/poudriere/common.sh.

1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
....
2365
2366
2367
2368
2369
2370
2371






2372
2373
2374
2375
2376
2377
2378
		build_json
		sleep 2
	done
}

build_json() {
	local log=$(log_path)
	awk -vbuildname="${BUILDNAME}" \
		-vjail="${MASTERNAME}" \
		-vsetname="${SETNAME}" \
		-vptname="${PTNAME}" \
		-f ${AWKPREFIX}/json.awk ${log}/.poudriere.* | \
		awk 'ORS=""; {print}' | \
		sed  -e 's/,\([]}]\)/\1/g' \
		> ${log}/.data.json.tmp
	mv -f ${log}/.data.json.tmp ${log}/.data.json
}

................................................................................
	# Record the SVN URL@REV in the build
	[ -d ${MASTERMNT}/usr/ports/.svn ] && bset svn_url $(
		svn info ${MASTERMNT}/usr/ports | awk '
			/URL: / {URL=substr($0, 6)}
			/Revision: / {REVISION=substr($0, 11)}
			END { print URL "@" REVISION }
		')







	bset status "computingdeps:"
	parallel_start
	for port in $(listed_ports); do
		[ -d "${MASTERMNT}/usr/ports/${port}" ] ||
			err 1 "Invalid port origin: ${port}"
		parallel_run compute_deps ${port}







|
<
<
<







 







>
>
>
>
>
>







1583
1584
1585
1586
1587
1588
1589
1590



1591
1592
1593
1594
1595
1596
1597
....
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
		build_json
		sleep 2
	done
}

build_json() {
	local log=$(log_path)
	awk \



		-f ${AWKPREFIX}/json.awk ${log}/.poudriere.* | \
		awk 'ORS=""; {print}' | \
		sed  -e 's/,\([]}]\)/\1/g' \
		> ${log}/.data.json.tmp
	mv -f ${log}/.data.json.tmp ${log}/.data.json
}

................................................................................
	# Record the SVN URL@REV in the build
	[ -d ${MASTERMNT}/usr/ports/.svn ] && bset svn_url $(
		svn info ${MASTERMNT}/usr/ports | awk '
			/URL: / {URL=substr($0, 6)}
			/Revision: / {REVISION=substr($0, 11)}
			END { print URL "@" REVISION }
		')

	bset mastername "${MASTERNAME}"
	bset jailname "${JAILNAME}"
	bset setname "${SETNAME}"
	bset ptname "${PTNAME}"
	bset buildname "${BUILDNAME}"

	bset status "computingdeps:"
	parallel_start
	for port in $(listed_ports); do
		[ -d "${MASTERMNT}/usr/ports/${port}" ] ||
			err 1 "Invalid port origin: ${port}"
		parallel_run compute_deps ${port}

Changes to src/share/poudriere/html/index.html.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
				<table class="layout">
					<tr>
						<td rowspan="2">
							<div id="build_info">
								<table border=0>
									<tr>
										<th>Jail:</th>
										<td id="jail"></td>
									</tr>
									<tr>
										<th>Build:</th>
										<td id="buildname"></td>
									</tr>
									<tr>
										<th>SVN:</th>







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
				<table class="layout">
					<tr>
						<td rowspan="2">
							<div id="build_info">
								<table border=0>
									<tr>
										<th>Jail:</th>
										<td id="mastername"></td>
									</tr>
									<tr>
										<th>Build:</th>
										<td id="buildname"></td>
									</tr>
									<tr>
										<th>SVN:</th>

Changes to src/share/poudriere/html/poudriere.js.

134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
function process_data(data) {
	var html, a, n;

	if (data.stats) {
		update_canvas(data.stats);
	}

	document.title = 'Poudriere bulk results for ' + data.jail +
		data.buildname;

	$('#jail').html(data.jail);
	$('#buildname').html(data.buildname);
	if (data.svn_url)
		$('#svn_url').html(data.svn_url);
	else
		$('#svn_url').hide();

	/* Builder status */







|


|







134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
function process_data(data) {
	var html, a, n;

	if (data.stats) {
		update_canvas(data.stats);
	}

	document.title = 'Poudriere bulk results for ' + data.mastername +
		data.buildname;

	$('#mastername').html(data.mastername);
	$('#buildname').html(data.buildname);
	if (data.svn_url)
		$('#svn_url').html(data.svn_url);
	else
		$('#svn_url').hide();

	/* Builder status */