forked from BladeGroup/gitlab-oe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-bitbake
executable file
·63 lines (52 loc) · 1.3 KB
/
run-bitbake
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
#!/bin/sh
set -e
die() {
echo >&2 "ERROR: $*"
exit 1
}
B=""
while [ $# -gt 1 ]; do
case "$1" in
--dir)
B="$2"
shift
;;
--)
shift
break
;;
-*)
die "unknown flag '$1'"
;;
*)
break
;;
esac
shift
done
[ -d "$B" ] || die "directory '$B' does not exist"
set +e
# now get the job's exit code and make sure we exit with it
./ci/run --dir "$B" bitbake "$@"
BB_RET=$?
# BEGIN poor man's after_script, can't use that gitlab-ci feature as
# it is already filled by oe_deploy
mkdir -p artifacts
find build \
-path 'build/tmp/work/*/*/*/temp/log.*.*' \
-not -name '*_setscene.*' \
-not -name '*.do_rm_work*' |
sed s,^build/tmp/work/,, |
while IFS=/ read arch pkg v _temp file; do
mkdir -p artifacts/$arch/${pkg}_$v
ln build/tmp/work/$arch/$pkg/$v/temp/$file artifacts/$arch/${pkg}_$v/$file
done
# cooker logs, more easily accessible than in the job jog
mkdir -p artifacts/cooker
cp $(find "$B/tmp/log/cooker" -type f) artifacts/cooker/
# build stats for separate analysis
cp -al "$B/tmp/buildstats" artifacts/
# publish build history
git -C "$B/buildhistory" push origin HEAD
# END poor man's after_script
exit $BB_RET