-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun_stabilization.sh
executable file
·83 lines (73 loc) · 1.66 KB
/
run_stabilization.sh
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
#!/bin/bash
# check the artifact directory of a build for generating LAVA jobs
# LAVA lifecycle (Generating, submit, check) is done by run_tests.py
ARCH=$1 # amd64
# make cannot handle ":" in a path, so we need to replace it
BUILDER_NAME=$2 # gentoo_sources
TOOLCHAIN_TODO="gcc"
if [ -z "$TOOLCHAIN_TODO" ];then
echo "ERROR: I do not find the toolchain to use"
exit 1
else
echo "DEBUG: build use toolchain $TOOLCHAIN_TODO"
fi
BUILD_NUMBER=$3 # 16
DISCOVERY_TIME=$4
PACKAGES_ARRAY=${*:5}
FILESERVER=/var/www/fileserver/
STORAGE_SERVER=140.211.166.173:8080
SCRIPT_DIR=$(cd "$(dirname "$0")"|| exit;pwd)
echo "$PACKAGES_ARRAY"
usage() {
echo "Usage: $0 ARCH BUILDER_NAME BUILD_NUMBER"
}
if [ -z "$ARCH" ] ;then
usage
exit 1
fi
if [ -z "$BUILDER_NAME" ] ;then
usage
exit 1
fi
if [ -z "$BUILD_NUMBER" ] ;then
usage
exit 1
fi
LINUX_ARCH=$ARCH
# insert ARCH hack for name here
case $ARCH in
amd64)
LINUX_ARCH=x86_64
;;
ppc64)
LINUX_ARCH=powerpc
;;
386)
LINUX_ARCH=i386
;;
esac
# permit to override default
if [ -e config.ini ];then
echo "INFO: Loading default from config.ini"
. config.ini
fi
for package in $PACKAGES_ARRAY
do
SCANDIR="$FILESERVER/$package/$ARCH/$DISCOVERY_TIME/"
if [ ! -e "$SCANDIR" ];then
echo "ERROR: $SCANDIR does not exists"
exit 1
fi
echo "CHECK $SCANDIR"
./deploy.py --arch "$LINUX_ARCH" \
--buildname "$BUILDER_NAME" \
--buildnumber "$BUILD_NUMBER" \
--toolchain "$TOOLCHAIN_TODO" \
--defconfig "${LINUX_ARCH}_defconfig" \
--relpath "/$package/$ARCH/$DISCOVERY_TIME/" \
--fileserver $FILESERVER \
--fileserverfqdn "http://$STORAGE_SERVER/" \
--waitforjobsend \
|| exit $?
done
exit 0