aboutsummaryrefslogtreecommitdiffstats
path: root/jjb/common/include-agl-run-test-short.sh
blob: 0e16e055ae462d36056f2c45ebc9f8bce49296de (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
# (c) 2016 Jan-Simon Moeller dl9pf(at)gmx.de
# License GPLv2

################################################################################
## Run SHORT CI test
################################################################################

#set -x

UPLOAD_URL_BASE=http://download.automotivelinux.org/AGL/upload/ci
UPLOAD_URL=${UPLOAD_URL_BASE}/${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}/${MACHINE}

cd $REPODIR

wget -q ${UPLOAD_URL}/build-info || echo "ERROR: fail to download ${UPLOAD_URL}/build-info"
if [ -e build-info ]; then
	cat build-info
	source build-info
fi

BUILD_VERSION=""
if [[ ! -z $DIST_BUILD_TOPIC ]]; then
	BUILD_VERSION="$DIST_BUILD_TOPIC"
else
    [[ ! -z $DIST_BB_DISTRO_VERSION ]] && BUILD_VERSION="$DIST_BB_DISTRO_VERSION-${DIST_LAYERS_MD5:0:8}"
fi

echo "# LAVA lab target: ${LAVA_LAB} #"
# releng-scripts depends on jinja2 >= 2.9
echo "## Check version of python-jinja2: "
pip show jinja2
CREATE_ARGS=""
CREATE_ARGS+="--machine ${releng_device} "
CREATE_ARGS+="--build-type ci "
[[ ! -z $GERRIT_CHANGE_NUMBER ]] && CREATE_ARGS+="--changeid $GERRIT_CHANGE_NUMBER "
[[ ! -z $GERRIT_PATCHSET_NUMBER ]] && CREATE_ARGS+="--patchset $GERRIT_PATCHSET_NUMBER "
CREATE_ARGS+="--name AGL-gerrit-$GERRIT_CHANGE_NUMBER-$GERRIT_PATCHSET_NUMBER "
[[ ! -z "$BUILD_VERSION" ]] && CREATE_ARGS+="--build-version $BUILD_VERSION "
[[ ! -z $DIST_BUILD_HASH ]] && CREATE_ARGS+="--commit $DIST_BUILD_HASH "
[[ ! -z $DIST_BUILD_ID ]] && CREATE_ARGS+="--build-id $DIST_BUILD_ID "
[[ ! -z $DIST_BB_AGL_BRANCH ]] && CREATE_ARGS+="--branch $DIST_BB_AGL_BRANCH "
[[ ! -z $DIST_BB_AGLVERSION ]] && CREATE_ARGS+="--version $DIST_BB_AGLVERSION "
CREATE_ARGS+="--callback-from ${LAVA_LAB} "
if [[ ! -z $lavacli_tags ]]; then
    CREATE_ARGS+="--device-tags ${lavacli_tags} "
fi
echo "DEBUG: call create-jobs.py with $CREATE_ARGS"
$RELENG/utils/create-jobs.py ${CREATE_ARGS} > testjob.yaml

if [ $? != 0 ]; then
    echo "ERROR: Machine ${releng_device}: LAVA job creation failed."
    exit 0
else
    cat testjob.yaml
fi