Skip to content

Commit ec9b650

Browse files
committed
[CI] Check stack version with regex for 8.x compatibility tests
1 parent c196b10 commit ec9b650

File tree

2 files changed

+32
-31
lines changed

2 files changed

+32
-31
lines changed

.ci/run-elasticsearch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ environment=($(cat <<-END
4545
END
4646
))
4747

48-
if [[ "$STACK_VERSION" == "8.0.0-SNAPSHOT" ]]; then
48+
if [[ $STACK_VERSION =~ (^8\.) ]]; then
4949
environment+=($(cat <<-EOF
5050
--env ELASTIC_PASSWORD=$elastic_password
5151
--env node.roles=data,data_cold,data_content,data_frozen,data_hot,data_warm,ingest,master,ml,remote_cluster_client,transform

.ci/run-repository.sh

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ echo -e "\033[1m>>>>> Run [elastic/elasticsearch-ruby container] >>>>>>>>>>>>>>>
3838

3939
repo=`pwd`
4040

41-
if [[ $STACK_VERSION == "8.0.0-SNAPSHOT" ]]; then
41+
if [[ $STACK_VERSION =~ "^8\." ]]; then
4242
environment=($(cat <<-EOF
4343
--env ELASTIC_CLIENT_APIVERSIONING=true
4444
--env ELASTIC_PASSWORD=${elastic_password}
@@ -51,7 +51,7 @@ EOF
5151
fi
5252

5353
# run the client tests
54-
if [[ $STACK_VERSION == "8.0.0-SNAPSHOT" ]]; then
54+
if [[ $STACK_VERSION =~ (^8\.) ]]; then
5555
docker run \
5656
-u "$(id -u)" \
5757
--network="${network_name}" \
@@ -68,33 +68,34 @@ if [[ $STACK_VERSION == "8.0.0-SNAPSHOT" ]]; then
6868
--rm \
6969
elastic/elasticsearch-ruby \
7070
bundle exec rake elasticsearch:download_artifacts test:rest_api
71-
elif [[ $TEST_SUITE != "platinum" ]]; then
72-
docker run \
73-
-u "$(id -u)" \
74-
--network="${network_name}" \
75-
--env "TEST_ES_SERVER=${elasticsearch_url}" \
76-
--env "TEST_SUITE=${TEST_SUITE}" \
77-
--env "STACK_VERSION=${STACK_VERSION}" \
78-
--volume $repo:/usr/src/app \
79-
--volume=/tmp:/tmp \
80-
--name elasticsearch-ruby \
81-
--rm \
82-
elastic/elasticsearch-ruby \
83-
bundle exec rake elasticsearch:download_artifacts test:rest_api
8471
else
85-
docker run \
86-
-u "$(id -u)" \
87-
--network="${network_name}" \
88-
--env "TEST_ES_SERVER=${elasticsearch_url}" \
89-
--env "ELASTIC_PASSWORD=${elastic_password}" \
90-
--env "TEST_SUITE=${TEST_SUITE}" \
91-
--env "ELASTIC_USER=elastic" \
92-
--env "SINGLE_TEST=${SINGLE_TEST}" \
93-
--env "STACK_VERSION=${STACK_VERSION}" \
94-
--env "ELASTIC_CLIENT_APIVERSIONING=${ELASTIC_API_VERSIONING:-false}" \
95-
--volume $repo:/usr/src/app \
96-
--name elasticsearch-ruby \
97-
--rm \
98-
elastic/elasticsearch-ruby \
99-
bundle exec rake elasticsearch:download_artifacts test:security
72+
if [[ $TEST_SUITE != "platinum" ]]; then
73+
docker run \
74+
-u "$(id -u)" \
75+
--network="${network_name}" \
76+
--env "TEST_ES_SERVER=${elasticsearch_url}" \
77+
--env "TEST_SUITE=${TEST_SUITE}" \
78+
--env "STACK_VERSION=${STACK_VERSION}" \
79+
--volume $repo:/usr/src/app \
80+
--volume=/tmp:/tmp \
81+
--name elasticsearch-ruby \
82+
--rm \
83+
elastic/elasticsearch-ruby \
84+
bundle exec rake elasticsearch:download_artifacts test:rest_api
85+
else
86+
docker run \
87+
-u "$(id -u)" \
88+
--network="${network_name}" \
89+
--env "TEST_ES_SERVER=${elasticsearch_url}" \
90+
--env "ELASTIC_USER=elastic" \
91+
--env "ELASTIC_PASSWORD=${elastic_password}" \
92+
--env "TEST_SUITE=${TEST_SUITE}" \
93+
--env "SINGLE_TEST=${SINGLE_TEST}" \
94+
--env "STACK_VERSION=${STACK_VERSION}" \
95+
--volume $repo:/usr/src/app \
96+
--name elasticsearch-ruby \
97+
--rm \
98+
elastic/elasticsearch-ruby \
99+
bundle exec rake elasticsearch:download_artifacts test:security
100+
fi
100101
fi

0 commit comments

Comments
 (0)