summaryrefslogtreecommitdiff
path: root/tcwg-update-host-containers.sh
blob: 8308868049200b3362c2ae3ab139193176ed69cb (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 -euf -o pipefail

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

distro="${distro-default}"
node="${node-host}"
group="${group-default}"
force="${force-false}"
test_docker="${test_docker-false}"
additional_options="${additional_options-}"
dryrun="${dryrun-false}"
verbose="${verbose-true}"

if $verbose; then set -x; fi

# Resolve LTS and LTS-1 values to Ubuntu distros.
case "$distro" in
    lts_1) distro=focal ;;
    lts|default) distro=jammy ;;
esac

image="linaro/ci-$(print_arch_for_host localhost)-tcwg-host-ubuntu:$distro"

if [ x"$group" = x"default" ]; then
    group="all"
    if [ x"$node" != x"host" ]; then
	group="tcwg-infra"
    fi
fi

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

$scripts/tcwg-start-container.sh \
    --container "$node" \
    --dryrun "$dryrun" \
    --image "$image" \
    --keep_existing "$keep_existing" \
    --test_docker "$test_docker" \
    --additional_options "$additional_options" \
    --verbose "$verbose" \
    -- \
    $image $group $node