Skip to content
Snippets Groups Projects
Commit 702f2fb2 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add set meilisearch env to df-wiki-cli

parent b9e797c5
No related branches found
No related tags found
No related merge requests found
Pipeline #115675 failed
...@@ -211,10 +211,13 @@ update-refseq-index:prod: ...@@ -211,10 +211,13 @@ update-refseq-index:prod:
variables: variables:
MEILI_HOST: "http://localhost:7700" MEILI_HOST: "http://localhost:7700"
before_script: before_script:
- apt update - pip install df-wiki-cli --index-url https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.pasteur.fr/api/v4/projects/5222/packages/pypi/simple
- pip install meilisearch
script: script:
- ./scripts/set-meili-api-key-env.py --key "${MEILI_MASTER_KEY}" --host ${MEILI_HOST} >> build.env - >
df-wiki-cli meilisearch
--key "${MEILI_MASTER_KEY}"
--host ${MEILI_HOST}
--output build.env
artifacts: artifacts:
reports: reports:
dotenv: build.env dotenv: build.env
...@@ -263,24 +266,6 @@ get-pfam: ...@@ -263,24 +266,6 @@ get-pfam:
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
# format-pfam:
# image: python:3.11
# stage: format-data
# needs:
# - "get-pfam"
# before_script:
# - pip install pandas
# - ls -al
# # - mv Pfam-A.hmm.dat scripts/
# script:
# - ./scripts/pfam-a-hmm-to-csv.py
# - mv Pfam-A.hmm.dat.csv content/_partials/_pfam-a-hmm.csv
# artifacts:
# paths:
# - content/_partials/_pfam-a-hmm.csv
# rules:
# - if: $CI_COMMIT_BRANCH == "main"
################ BUILD ########################## ################ BUILD ##########################
......
...@@ -67,3 +67,25 @@ def delete_all_documents(ctx: typer.Context, id: str): ...@@ -67,3 +67,25 @@ def delete_all_documents(ctx: typer.Context, id: str):
def task(ctx: typer.Context, id: str): def task(ctx: typer.Context, id: str):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key) client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
print(client.get_task(id)) print(client.get_task(id))
@app.command("get-env-var")
def get_env_var(
ctx: typer.Context,
output: Annotated[
Path,
typer.Option(
exists=False,
file_okay=True,
writable=True,
),
] = "build.env",
):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
keys = client.get_keys()
api_key = [res.key for res in keys.results if res.name == "Default Search API Key"]
if len(api_key) == 1:
with open(output, "a") as outfile:
outfile.write(f"MEILI_HOST={ctx.obj.host}\n")
outfile.write(f"MEILI_API_KEY={api_key[0]}\n")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment