Skip to content

Commit 59dd8d7

Browse files
committed
Add pull argument to Ubuntu GHA setup script
1 parent 79659d9 commit 59dd8d7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.ci/ubuntu/gha-setup.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ else
3131
readonly run_toxiproxy='false'
3232
fi
3333

34+
if [[ $2 == 'pull' ]]
35+
then
36+
readonly docker_pull_args='--pull always'
37+
else
38+
readonly docker_pull_args=''
39+
fi
40+
3441
set -o nounset
3542

3643
declare -r rabbitmq_docker_name="$docker_name_prefix-rabbitmq"
@@ -43,7 +50,8 @@ function start_toxiproxy
4350
# sudo ss -4nlp
4451
echo "[INFO] starting Toxiproxy server docker container"
4552
docker rm --force "$toxiproxy_docker_name" 2>/dev/null || echo "[INFO] $toxiproxy_docker_name was not running"
46-
docker run --detach \
53+
# shellcheck disable=SC2086
54+
docker run --detach $docker_pull_args \
4755
--name "$toxiproxy_docker_name" \
4856
--hostname "$toxiproxy_docker_name" \
4957
--publish 8474:8474 \
@@ -58,7 +66,8 @@ function start_rabbitmq
5866
echo "[INFO] starting RabbitMQ server docker container"
5967
chmod 0777 "$GITHUB_WORKSPACE/.ci/ubuntu/log"
6068
docker rm --force "$rabbitmq_docker_name" 2>/dev/null || echo "[INFO] $rabbitmq_docker_name was not running"
61-
docker run --detach \
69+
# shellcheck disable=SC2086
70+
docker run --detach $docker_pull_args \
6271
--name "$rabbitmq_docker_name" \
6372
--hostname "$rabbitmq_docker_name" \
6473
--publish 5671:5671 \
@@ -101,7 +110,8 @@ function wait_rabbitmq
101110

102111
function get_rabbitmq_id
103112
{
104-
local rabbitmq_docker_id="$(docker inspect --format='{{.Id}}' "$rabbitmq_docker_name")"
113+
local rabbitmq_docker_id
114+
rabbitmq_docker_id="$(docker inspect --format='{{.Id}}' "$rabbitmq_docker_name")"
105115
echo "[INFO] '$rabbitmq_docker_name' docker id is '$rabbitmq_docker_id'"
106116
if [[ -v GITHUB_OUTPUT ]]
107117
then

0 commit comments

Comments
 (0)