Skip to content

Commit 5c5ec84

Browse files
committed
Added export functions in build-tests
1 parent df98dd5 commit 5c5ec84

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.buildkite/build-tests.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,24 @@ script_path=$(dirname $(realpath -s $0))
99
set -euo pipefail
1010

1111
PHP_VERSION=${PHP_VERSION-8.4-cli}
12-
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
1312
elasticsearch_container=${elasticsearch_container-}
1413

1514
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
1615
echo -e "\033[34;1mINFO:\033[0m TEST_GROUP ${TEST_GROUP}\033[0m"
17-
echo -e "\033[34;1mINFO:\033[0m URL ${ELASTICSEARCH_URL}\033[0m"
1816
echo -e "\033[34;1mINFO:\033[0m CONTAINER ${elasticsearch_container}\033[0m"
1917
echo -e "\033[34;1mINFO:\033[0m PHP_VERSION ${PHP_VERSION}\033[0m"
2018

2119
echo -e "\033[1m>>>>> Build docker container >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
2220

21+
export elasticsearch_image=elasticsearch
22+
export elasticsearch_container="${elasticsearch_image}:${STACK_VERSION}"
23+
export suffix=rest-test
24+
export moniker=$(echo "$elasticsearch_container" | tr -C "[:alnum:]" '-')
25+
export network_name=${moniker}${suffix}
26+
27+
echo -e "\033[34;1mINFO:\033[0m Creating network $network_name if it does not exist already \033[0m"
28+
docker network inspect "$network_name" > /dev/null 2>&1 || docker network create "$network_name"
29+
2330
docker build \
2431
--no-cache \
2532
--file $script_path/Dockerfile \
@@ -38,7 +45,6 @@ docker run \
3845
--env STACK_VERSION=${STACK_VERSION} \
3946
--env TEST_GROUP=${TEST_GROUP} \
4047
--env PHP_VERSION=${PHP_VERSION} \
41-
--env ELASTICSEARCH_URL=${ELASTICSEARCH_URL} \
4248
--ulimit nofile=65535:65535 \
4349
--name elasticsearch-php \
4450
--rm \

0 commit comments

Comments
 (0)