summaryrefslogtreecommitdiff
path: root/tcwg-dev-build.sh
blob: 9b295e75259b8ca98b75cd65e6d51cdfd235e983 (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
#!/bin/bash

set -ef -o pipefail

scripts=$(dirname $0)
# shellcheck source=jenkins-helpers.sh
. $scripts/jenkins-helpers.sh
convert_args_to_variables "$@"

abe_branch="${abe_branch-tested}"
dry_run="${dry_run-false}"
manifest="${manifest-}"
release_name="${release_name-default}"
buildnumber="${buildnumber-0}"
target="${target-aarch64-linux-gnu}"
version="${version-default}"
verbose="${verbose-true}"

set -u

if $verbose; then set -x; fi

clone_or_update_repo abe $abe_branch https://git-us.linaro.org/toolchain/abe

if [ x"$release_name" = x"default" ]; then
    release_name="$(date +%Y%m%d-%H_%M_%S)"
fi

manifest_opt=
if [ -f "$manifest" ]; then
    manifest_opt="--manifest $(abs_path "$manifest")"
fi

manifest_validation_opt=
if [ x"$target" = x"native" ]; then
    manifest_validation_opt="--manifest_validation false"
fi

# shellcheck disable=SC2154
$scripts/MakeRelease.job \
    --abedir "$(pwd)"/abe \
    --artifacts_top "$(pwd)"/artifacts \
    --release_name $release_name \
    --buildnumber $buildnumber \
    --target $target \
    --toolchainconfig $version \
    --workspace "$(pwd)" \
    $manifest_opt \
    $manifest_validation_opt \
    ${binutils:+--binutils "$binutils"} \
    ${gcc:+--gcc "$gcc"}