aboutsummaryrefslogtreecommitdiff
path: root/scripts/submit_to_lava
blob: 7df5f2c7b66a1c9254ea20f6b9e172cd96956865 (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
#!/bin/bash
set -x
set -e
shopt -s extglob

pvar()
{
	echo "$1=${!1}"
}

# remember if tracing is on and turn it off
unset xtrace
set -o | grep -q 'xtrace.*on' && xtrace='true'
set +x

OUT=out/$BUILD_NUMBER
jobfile=$OUT/jobfile.json
lava_job_id=$(lava-tool \
	submit-job \
	https://$LAVA_USER:$LAVA_TOKEN@validation.linaro.org/RPC2/ \
	$jobfile | \
		grep -v EXPERIMENTAL | cut -d ":" -f 2 | tr -d ' ')

# turn tracing back on if it was on before
test "$xtrace" = "true" && set -x

lava_job_url="http://validation.linaro.org/scheduler/job/$lava_job_id"
pvar "lava_job_id" >> $OUT/jobinfo.sh
pvar "lava_job_url" >> $OUT/jobinfo.sh