forked from kernelci/kernelci-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chromeos.kernelci.org
executable file
·190 lines (163 loc) · 4.56 KB
/
chromeos.kernelci.org
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/dash
# Periodic job run on chromeos.kernelci.org to merge together all the pending
# PRs and update the chromeos.kernelci.org branches, trigger a full build/test
# cycle with a test kernel branch.
set -e
# Trap function for errors
crash() {
local exit_code="$?"
# If exit code is 0, then it's not an error
[ "$exit_code" -eq 0 ] && exit 0
# Generate syslog message
logger -t kernelci-deploy "Error in script $0"
exit $exit_code
}
trap 'crash' EXIT
CHROMEOS_SETTINGS="data/chromeos.ini"
SSH_KEY="keys/id_rsa_staging.kernelci.org"
TAG_PREFIX='chromeos-'
MAIN='chromeos'
cmd_pull() {
echo "Updating local repository"
git pull --ff-only
}
cmd_jenkins() {
echo "Updating Jenkins jobs"
./pending.py \
kernelci-jenkins \
--settings=${CHROMEOS_SETTINGS} \
--ssh-key=${SSH_KEY} \
--main=${MAIN} \
--tag-prefix=${TAG_PREFIX} \
--push
}
cmd_core() {
echo "Updating kernelci-core"
./pending.py \
kernelci-core \
--settings=${CHROMEOS_SETTINGS} \
--ssh-key=${SSH_KEY} \
--main=${MAIN} \
--tag-prefix=${TAG_PREFIX} \
--push
}
cmd_test_definitions() {
echo "Updating test-definitions"
./pending.py \
test-definitions \
--settings=${CHROMEOS_SETTINGS} \
--ssh-key=${SSH_KEY} \
--main=${MAIN} \
--tag-prefix=${TAG_PREFIX} \
--push
}
cmd_backend() {
echo "Updating kernelci-backend"
./pending.py \
kernelci-backend \
--settings=${CHROMEOS_SETTINGS} \
--ssh-key=${SSH_KEY} \
--main=${MAIN} \
--tag-prefix=${TAG_PREFIX} \
--push
./ansible \
kernelci-backend \
api.chromeos.kernelci.org \
chromeos.kernelci.org \
chromeos.kernelci.org \
$PWD/keys/id_rsa_kernelci.org
}
cmd_frontend() {
echo "Updating kernelci-frontend"
./pending.py \
kernelci-frontend \
--settings=${CHROMEOS_SETTINGS} \
--ssh-key=${SSH_KEY} \
--main=${MAIN} \
--tag-prefix=${TAG_PREFIX} \
--push
./ansible \
kernelci-frontend \
chromeos.kernelci.org \
chromeos.kernelci.org \
chromeos.kernelci.org \
$PWD/keys/id_rsa_kernelci.org
}
cmd_docker() {
echo "Updating Docker images"
# Build the images with kci_docker
cd checkout/kernelci-core
core_rev=$(git show --pretty=format:%H -s origin/chromeos.kernelci.org)
rev_arg="--build-arg core_rev=$core_rev"
px_arg='--prefix=kernelci/cros-'
args="build --push $px_arg $rev_arg"
# KernelCI tools
./kci docker $args kernelci
./kci docker $args k8s kernelci $rev_arg
# Compiler toolchains
for clang in clang-17; do
./kci docker $args $clang kselftest kernelci $rev_arg
for arch in arm arm64 x86; do
./kci docker $args $clang kselftest kernelci $rev_arg --arch $arch
done
done
for arch in arm arm64 x86; do
./kci docker $args gcc-10 kselftest kernelci --arch $arch $rev_arg
done
px_arg='--prefix=kernelci/'
args="build --push $px_arg $rev_arg"
# ChromeOS related images
# cros-sdk used to create ChromiumOS rootfs, so it needs kernelci-core
# also we dont need cros- prefix as with compilers
./kci docker $args cros-sdk kernelci
for imgname in cros-baseline cros-qemu-modules cros-tast; do
./kci docker $args $rev_arg $imgname
done
cd -
}
cmd_kernel() {
echo "Pushing chromeos-stable kernel test branch"
./kernel.py \
--push \
--ssh-key=keys/id_rsa_staging.kernelci.org \
--from-url=https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git \
--from-branch=linux-6.1.y \
--branch=chromeos-stable \
--tag-prefix=chromeos-stable-
echo "Pushing linux-6.1.y-arm64-chromeos kernel test branch"
./kernel.py \
--push \
--ssh-key=keys/id_rsa_staging.kernelci.org \
--from-url git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git \
--from-branch linux-6.1.y \
--branch linux-6.1.y-arm64-chromeos \
--tag-prefix=linux-6.1.y-arm64-chromeos-
}
cmd_monitor() {
echo "Triggering Jenkins kernel-tree-monitor job"
python3 \
job.py \
--json=data/chromeos-monitor.json \
trigger \
chromeos/kernel-tree-monitor
}
cmd_all() {
tree="$1"
cmd_pull
cmd_jenkins
cmd_core
cmd_test_definitions
# cmd_backend
# cmd_frontend
cmd_kernel
cmd_docker
cmd_monitor
}
cmd="${1}"
if [ -n "$cmd" ]; then
shift 1
else
cmd="all"
fi
"cmd_"$cmd $@
exit 0