Set up CI for elasticsearch-oss

Signed-off-by: Rushi Agrawal <[email protected]>
This commit is contained in:
Rushi Agrawal
2021-08-06 12:25:34 +05:30
parent 934ea8cc5e
commit 200d3c584f
7 changed files with 40 additions and 28 deletions
+2 -3
View File
@@ -18,14 +18,14 @@ require_stack_version
if [[ -z $es_node_name ]]; then if [[ -z $es_node_name ]]; then
# only set these once # only set these once
set -euo pipefail set -euo pipefail
export TEST_SUITE=${TEST_SUITE-platinum} export TEST_SUITE=${TEST_SUITE-free}
export RUNSCRIPTS=${RUNSCRIPTS-} export RUNSCRIPTS=${RUNSCRIPTS-}
export DETACH=${DETACH-false} export DETACH=${DETACH-false}
export CLEANUP=${CLEANUP-false} export CLEANUP=${CLEANUP-false}
export es_node_name=instance export es_node_name=instance
export elastic_password=changeme export elastic_password=changeme
export elasticsearch_image=elasticsearch export elasticsearch_image=elasticsearch-oss
export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200 export elasticsearch_url=https://elastic:${elastic_password}@${es_node_name}:9200
if [[ $TEST_SUITE != "platinum" ]]; then if [[ $TEST_SUITE != "platinum" ]]; then
export elasticsearch_url=http://${es_node_name}:9200 export elasticsearch_url=http://${es_node_name}:9200
@@ -56,4 +56,3 @@ fi
echo -e "\033[34;1mINFO:\033[0m Creating network $network_name if it does not exist already \033[0m" echo -e "\033[34;1mINFO:\033[0m Creating network $network_name if it does not exist already \033[0m"
docker network inspect "$network_name" > /dev/null 2>&1 || docker network create "$network_name" docker network inspect "$network_name" > /dev/null 2>&1 || docker network create "$network_name"
+1 -15
View File
@@ -17,7 +17,6 @@
# - Added 5 retries on docker pull for fixing transient network errors # - Added 5 retries on docker pull for fixing transient network errors
# - Added flags to make local CCR configurations work # - Added flags to make local CCR configurations work
# - Added action.destructive_requires_name=false as the default will be true in v8 # - Added action.destructive_requires_name=false as the default will be true in v8
# - Added ingest.geoip.downloader.enabled=false as it causes false positives in testing
script_path=$(dirname $(realpath -s $0)) script_path=$(dirname $(realpath -s $0))
source $script_path/functions/imports.sh source $script_path/functions/imports.sh
@@ -41,24 +40,11 @@ environment=($(cat <<-END
--env path.repo=/tmp --env path.repo=/tmp
--env repositories.url.allowed_urls=http://snapshot.test* --env repositories.url.allowed_urls=http://snapshot.test*
--env action.destructive_requires_name=false --env action.destructive_requires_name=false
--env ingest.geoip.downloader.enabled=false
END END
)) ))
if [[ "$TEST_SUITE" == "platinum" ]]; then if [[ "$TEST_SUITE" == "platinum" ]]; then
environment+=($(cat <<-END environment+=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password --env ELASTIC_PASSWORD=$elastic_password
--env xpack.license.self_generated.type=trial
--env xpack.security.enabled=true
--env xpack.security.http.ssl.enabled=true
--env xpack.security.http.ssl.verification_mode=certificate
--env xpack.security.http.ssl.key=certs/testnode.key
--env xpack.security.http.ssl.certificate=certs/testnode.crt
--env xpack.security.http.ssl.certificate_authorities=certs/ca.crt
--env xpack.security.transport.ssl.enabled=true
--env xpack.security.transport.ssl.verification_mode=certificate
--env xpack.security.transport.ssl.key=certs/testnode.key
--env xpack.security.transport.ssl.certificate=certs/testnode.crt
--env xpack.security.transport.ssl.certificate_authorities=certs/ca.crt
END END
)) ))
volumes+=($(cat <<-END volumes+=($(cat <<-END
@@ -110,7 +96,7 @@ END
docker run \ docker run \
--name "$node_name" \ --name "$node_name" \
--network "$network_name" \ --network "$network_name" \
--env "ES_JAVA_OPTS=-Xms1g -Xmx1g -da:org.elasticsearch.xpack.ccr.index.engine.FollowingEngineAssertions" \ --env "ES_JAVA_OPTS=-Xms1g -Xmx1g" \
"${environment[@]}" \ "${environment[@]}" \
"${volumes[@]}" \ "${volumes[@]}" \
--publish "$http_port":9200 \ --publish "$http_port":9200 \
+2 -2
View File
@@ -5,8 +5,8 @@
# - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products # - Add `$RUNSCRIPTS` env var for running Elasticsearch dependent products
# Default environment variables # Default environment variables
export STACK_VERSION="${STACK_VERSION:=8.0.0-SNAPSHOT}" export STACK_VERSION="${STACK_VERSION:=7.10.2}"
export TEST_SUITE="${TEST_SUITE:=platinum}" export TEST_SUITE="${TEST_SUITE:=free}"
export PYTHON_VERSION="${PYTHON_VERSION:=3.9}" export PYTHON_VERSION="${PYTHON_VERSION:=3.9}"
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}" export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}"
+2 -2
View File
@@ -1,8 +1,8 @@
STACK_VERSION: STACK_VERSION:
- 7.x-SNAPSHOT - 7.10.2
TEST_SUITE: TEST_SUITE:
- platinum - free
PYTHON_VERSION: PYTHON_VERSION:
- "2.7" - "2.7"
+28
View File
@@ -0,0 +1,28 @@
name: Integration tests
on:
pull_request:
paths-ignore:
- 'README.md'
branches:
- "*"
push:
paths-ignore:
- 'README.md'
branches:
- "*"
jobs:
assemble:
name: Assemble
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
stack_version: ['7.10.2']
steps:
- name: Checkout
uses: actions/checkout@v2
- run: "./.ci/run-tests"
name: Integ ${{ matrix.stack_version }}
+4 -5
View File
@@ -4,14 +4,13 @@ on:
pull_request: pull_request:
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
branches:
- "*"
push: push:
paths-ignore: paths-ignore:
- 'README.md' - 'README.md'
branches: branches:
- main - "*"
- master
- '[0-9]+.[0-9]+'
- '[0-9]+.x'
jobs: jobs:
assemble: assemble:
@@ -20,7 +19,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
stack_version: ['7.x-SNAPSHOT'] stack_version: ['7.10.2']
steps: steps:
- name: Checkout - name: Checkout
+1 -1
View File
@@ -15,4 +15,4 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
__versionstr__ = "7.15.0" __versionstr__ = "7.10.2"