ci: do not hardcode es server in script

Use environment variable instead of hardcoding server in script. This
will allow reuse.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Anas Nashif 2023-02-02 12:12:00 +00:00 committed by Stephanos Ioannidis
parent fcd60cf789
commit 66fa169623
2 changed files with 2 additions and 3 deletions

View File

@ -268,6 +268,7 @@ jobs:
name: "Publish Unit Tests Results"
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
needs: twister-build
runs-on: ubuntu-20.04
# the build-and-test job might be skipped, we don't need to run this job then

View File

@ -14,8 +14,6 @@ import os
import json
import argparse
host = "https://elasticsearch.zephyrproject.io:443"
def gendata(f, index):
with open(f, "r") as j:
data = json.load(j)
@ -63,7 +61,7 @@ def main():
sys.exit(0)
es = Elasticsearch(
[host],
[os.environ['ELASTICSEARCH_SERVER']],
api_key=os.environ['ELASTICSEARCH_KEY'],
verify_certs=False
)