summaryrefslogtreecommitdiff
path: root/tcwg-update-llvmbot-containers.sh
blob: 25439729ab91ae767279d1bb54d67a81cf114932 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/bash

set -euf -o pipefail

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

obligatory_variables NODE_NAME password
declare NODE_NAME password

distro="${distro-focal}"
force="${force-false}"
master="${master-silent}"
verbose="${verbose-true}"

if $verbose; then set -x; fi

if $force; then
    keep_existing=false
else
    keep_existing=keep_if_same_image
fi

case "$NODE_NAME:$master" in
    tcwg-jade-04:normal)
	bots=(
	    linaro-lldb-arm-ubuntu
	    linaro-lldb-aarch64-ubuntu
	)
	;;
    tcwg-jade-04:buildkite)
	bots=(
	    # 1 bot per config to limit the
	    # total build time to 1x the slowest config.
	    # aarch64 exceptions/no-exceptions
	    linaro-aarch64-libcxx-01
	    linaro-aarch64-libcxx-02
	    # These can all build any v7/8 config.
	    # 4 because there's 4 combinations.
	    # exceptions/no exceptions armv7/armv8
	    linaro-armv8-libcxx-01
	    linaro-armv8-libcxx-02
	    linaro-armv8-libcxx-03
	    linaro-armv8-libcxx-04
	)
	;;
    tcwg-fx-02:normal)
	bots=(
	    linaro-clang-aarch64-sve-vla
	    linaro-clang-aarch64-sve-vla-2stage
	    linaro-clang-aarch64-sve-vls
	    linaro-clang-aarch64-sve-vls-2stage
	)
	;;
    tcwg-jade-01:normal)
	bots=(
	    # Bots in same order as in llvm-zorg/.../workers.py
	    linaro-clang-armv7-lnt
	    linaro-clang-armv7-2stage
	    linaro-clang-armv7-quick
	    linaro-clang-armv7-global-isel
	    linaro-clang-armv7-vfpv3-2stage
	    linaro-clang-armv8-lld-2stage
	    linaro-clang-aarch64-quick
	    linaro-clang-aarch64-lld-2stage
	    linaro-clang-aarch64-global-isel
	    linaro-clang-aarch64-full-2stage
	    linaro-flang-aarch64-dylib
	    linaro-flang-aarch64-sharedlibs
	    linaro-flang-aarch64-out-of-tree
	    linaro-flang-aarch64-debug
	    linaro-flang-aarch64-latest-clang
	    linaro-flang-aarch64-release
	    linaro-flang-aarch64-rel-assert
	    linaro-flang-aarch64-latest-gcc
	)
	;;
    tcwg-llvmbot_tk1-09:silent)
	# Connect linaro-tk1-09 to silent buildmaster to test its stability
	bots=("$(echo "$NODE_NAME" | sed -e "s/tcwg-llvmbot_/linaro-/")")
	;;
    tcwg-llvmbot_tk1-09:normal)
	;;
    tcwg-llvmbot_tk1-*:normal)
	bots=("$(echo "$NODE_NAME" | sed -e "s/tcwg-llvmbot_/linaro-/")")
	;;
esac

for bot in "${bots[@]+${bots[@]}}"; do
    case "$bot" in
	linaro-*aarch64-*) arch="arm64" ;;
	linaro-*arm*|linaro-tk1-*) arch="armhf" ;;
	*) echo "ERROR: Unknown bot: $bot"; exit 1 ;;
    esac
    image="linaro/ci-$arch-tcwg-llvmbot-ubuntu:$distro"

    $scripts/tcwg-start-container.sh \
	--container "$master-$bot" \
	--image "$image" \
	--keep_existing "$keep_existing" \
	--verbose "$verbose" \
	-- \
	$image $master $bot $password
done