Skip to content

Commit

Permalink
[CI] Updates buildkite scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
picandocodigo committed Sep 25, 2023
1 parent ac53da8 commit 73a5402
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .buildkite/functions/imports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ require_stack_version
if [[ -z $es_node_name ]]; then
# only set these once
set -euo pipefail
export TEST_SUITE=${TEST_SUITE-free}
export RUNSCRIPTS=${RUNSCRIPTS-}
export DETACH=${DETACH-false}
export CLEANUP=${CLEANUP-false}
Expand Down
6 changes: 5 additions & 1 deletion .buildkite/run-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ set -euo pipefail
echo -e "\033[34;1mINFO:\033[0m Take down node if called twice with the same arguments (DETACH=true) or on seperate terminals \033[0m"
cleanup_node $es_node_name

BUILDKITE=${BUILDKITE-false}

# Set vm.max_map_count kernel setting to 262144
sudo sysctl -w vm.max_map_count=262144
if [[ "$BUILDKITE" == "true" ]]; then
sudo sysctl -w vm.max_map_count=262144
fi

master_node_name=${es_node_name}
cluster_name=${moniker}${suffix}
Expand Down
15 changes: 6 additions & 9 deletions .buildkite/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,24 @@ echo -e "\033[34;1mINFO:\033[0m VERSION: ${STACK_VERSION}\033[0m"
echo -e "\033[34;1mINFO:\033[0m TEST_SUITE: ${TEST_SUITE}\033[0m"
echo -e "\033[34;1mINFO:\033[0m RUNSCRIPTS: ${RUNSCRIPTS}\033[0m"

echo -e "\033[34;1mINFO:\033[0m pinging Elasticsearch ..\033[0m"
echo "--- :telephone_receiver: Pinging Elasticsearch :elasticsearch:"
curl --insecure --fail $external_elasticsearch_url/_cluster/health?pretty

if [[ "$RUNSCRIPTS" = *"enterprise-search"* ]]; then
enterprise_search_url="http://localhost:3002"
echo -e "\033[34;1mINFO:\033[0m pinging Enterprise Search ..\033[0m"
curl -I --fail $enterprise_search_url
fi
enterprise_search_url="http://localhost:3002"
echo "--- :telephone_receiver: Pinging Enterprise Search :elastic-enterprise-search:"
curl -I --fail $enterprise_search_url

echo -e "\033[32;1mSUCCESS:\033[0m successfully started the ${STACK_VERSION} stack.\033[0m"

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

echo "--- :docker: :php: Building Docker image"
docker build \
--no-cache \
--file $script_path/Dockerfile \
--tag elastic/enterprise-search-php \
--build-arg PHP_VERSION=${PHP_VERSION} \
.

echo -e "\033[1m>>>>> Run test:integration >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
echo "--- :docker: :php: Running Client Container"

repo=$(realpath $(dirname $(realpath -s $0))/../)

Expand Down
3 changes: 2 additions & 1 deletion .buildkite/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
# - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products
export CONTAINER_NAME=enterprise-search
export RUNSCRIPTS=enterprise-search
export TEST_SUITE=platinum

script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh
set -euo pipefail

echo "--- :elasticsearch: Starting Elasticsearch"
echo "--- :docker: :elasticsearch: Starting Elasticsearch"
DETACH=true bash $script_path/run-elasticsearch.sh

echo "--- :docker: :elastic-enterprise-search: Starting Enterprise Search"
Expand Down

0 comments on commit 73a5402

Please sign in to comment.