aboutsummaryrefslogtreecommitdiff
path: root/node/lava-submit
blob: 23a17b3df99288ba9b5b1f242b3f029a3da73ac0 (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
#!/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

# There should be one and only BUILD-INFO.txt per build, and it should
# include ACLs for all files at once.
## Add BUILD-INFO.txt support for lava-job-info files
#cp ${BUILD_SCRIPT_ROOT}/BUILD-INFO_lava.txt out/BUILD-INFO.txt

EOF