~pundiramit/linaro-android-build-tools/labt

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
#!/bin/bash

###############################################################################
# Copyright (c) 2011 Linaro
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
###############################################################################

set -xe

BUILD_SCRIPT_ROOT=$(readlink -f "$(dirname "${0}")/../build-scripts")

cd build
sudo -E -H -u jenkins-build bash -xes "${BUILD_SCRIPT_ROOT}" "$@" <<\EOF
export BUILD_SCRIPT_ROOT="${1}"
set -a
source /var/run/build-tools/build-config
set +a

if [ -z "$LAVA_SUBMIT" -o "$LAVA_SUBMIT" = "0" ]; then
    exit;
fi

if ! "${BUILD_SCRIPT_ROOT}"/post-build-lava.py; then
    if [ "$LAVA_SUBMIT_FATAL" != "0" ]; then
        exit 1
    else
        echo "warning: LAVA submission failed"
    fi
fi

EOF