aboutsummaryrefslogtreecommitdiff
path: root/jenkins/updatejobinfo
blob: 7867e41cbe678291a9de0c76edfa64c633326411 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
#set -x
set -e
shopt -s extglob

# add directory containing this script to PATH
#
export CIROOTDIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
export PATH="$CIROOTDIR/scripts:$CIROOTDIR/configs:$PATH"

prep()
{
	for try in $(seq 10)
	do
		type wget > /dev/null && break
		sudo apt-get -y install wget || echo "apt-get install failed, will try again"
		sleep 30
	done
}

print_head()
{
	cat << __END_OF_HEAD__
<head>
<link rel="stylesheet" type="text/css" href="http://www.linaro.org/remote/css/init.css">
<link rel="stylesheet" type="text/css" href="http://www.linaro.org/remote/css/remote.css"></head>
<body>
<div id="content">
<pre style="padding:0 0 0 10;">
<script type="text/javascript">
kernel_name=window.name;
if (!kernel_name) {
	kernel_name=window.parent.document.title;
	kernel_name=kernel_name.split(' ')[0];
	t=kernel_name.split('linux-linaro-')[1];
	if (t)
		kernel_name=t;
}
goodkernel=true;
switch (kernel_name) {
__END_OF_HEAD__
}

print_per()
{
	logurl="https://ci.linaro.org/jenkins/job/package-and-publish-linux-linaro-$kernel_name/lastBuild/consoleText"
	lavaurl=$(wget -q --no-check-certificate -q -O - $logurl |
			grep  -Po '(?<=echo lava_job_url=)http://validation.linaro.org.*') || echo ""
	cat << __END_OF_PER__
case "$kernel_name":
	kernel_repo="$kernel_repo";
	kernel_branch="$kernel_branch";
	board_config_repo="$board_config_repo";
	board_config_branch="$board_config_branch";
	board_config_frag="$board_config_frags";
	ubuntu_and_base_config_repo="$ubuntu_and_base_config_repo";
	ubuntu_and_base_config_branch="$ubuntu_and_base_config_branch";
	ubuntu_config_frag="$ubuntu_config_frag";
	linaro_base_config_frag="$linaro_base_config_frag";
	linaro_ubuntu_packaging_repo="$linaro_ubuntu_packaging_repo";
	linaro_ubuntu_packaging_branch="$linaro_ubuntu_packaging_branch";
	ppaurl="https://code.launchpad.net/~linaro-maintainers/+archive/staging-overlay/+packages?field.name_filter=$kernel_name";
	ppacopyurl="https://code.launchpad.net/~linaro-maintainers/+archive/staging-overlay/+copy-packages?field.name_filter=$kernel_name";
	lavaurl="$lavaurl";
	ppaname="Staging Overlay PPA";
	maintainermail="mailto:linaro-pkg@lists.launchpad.net"
	maintainername="Linaro Packagers"
	break;
__END_OF_PER__
}

print_foot()
{
	cat << __END_OF_FOOT__
default:
	goodkernel=false;
}
if (goodkernel) {
	document.writeln('Kernel packaging and publishing Job for ' + kernel_name);
	document.writeln('  Kernel: ' + kernel_repo + ' ' + kernel_branch);
	document.writeln('  Board config: ' + board_config_repo + ' ' + board_config_branch);
	document.writeln('  Board config frag: ' + board_config_frag);
	document.writeln('  Ubuntu and base config: ' + ubuntu_and_base_config_repo + ' ' + ubuntu_and_base_config_branch);
	document.writeln('  Ubuntu config frag: ' + ubuntu_config_frag);
	document.writeln('  Base config frag: ' + linaro_base_config_frag);
	document.writeln('  Linaro ubuntu packaging: ' + linaro_ubuntu_packaging_repo + ' ' + linaro_ubuntu_packaging_branch);
	document.writeln('  View package in <a target="_blank" href=' + ppaurl + '>' + ppaname + '</a>');
	document.writeln('  View test results in <a target="_blank" href=' + lavaurl + '>Lava Job</a>');
	document.writeln('  Copy package to another ppa: <a target="_blank" href=' + ppacopyurl + '>copy</a>');
	document.writeln('  Maintainer: <a target="_blank" href=' + maintainermail + '>' + maintainername + '</a>');
} else {
	document.writeln('Kernel Packaging and Publishing Job for unknown kernel: "' + kernel_name + '"');
	document.writeln('kernel name is:');
	document.writeln('  set via name=kernelname in iframe in project description');
	document.writeln('    or');
	document.writeln('  guessed from jenkins project name by removing everthing upto and including "linux-linaro"');
}
</script>
</pre>
</div>
</body>
__END_OF_FOOT__
}

export CFGDIR="$CIROOTDIR/configs"

foreach_kernel_cfg()
{
	for cfg in $CFGDIR/*.cfg
	do
		export kernel_name=$(basename $cfg .cfg)
		(
			source $cfg
			: ${linaro_base_config_frag:="linaro/configs/linaro-base.conf"}
			: ${ubuntu_config_frag:="linaro/configs/ubuntu.conf"}
			: ${board_config_frag:="linaro/configs/$(echo $SOCFLAVOUR | sed 's/l\?lt-//').conf"}
			: ${board_config_frags:="${board_config_frag}"}
			: ${third_version_digit:=0}
			: ${board_config_repo:="$kernel_repo"}
			: ${board_config_branch:="$kernel_branch"}
			eval $1
		)
	done
}

prep
print_head
foreach_kernel_cfg print_per
print_foot

exit 0