Skip to content

Commit

Permalink
feat: linked admin to frontend (#5465)
Browse files Browse the repository at this point in the history
* fix(e2e): correction des test e2e avec les données entreprises mise à jour (#5466)

* fix(e2e): correction des test e2e avec les données entreprises mise à jour

* fix test

* feat: linked admin to frontend

* fix: use the short version of the branch name

* feat: utilise l'index seulement si la branche démarre par linked

---------

Co-authored-by: Caroline <[email protected]>
  • Loading branch information
m-maillot and carolineBda authored Dec 7, 2023
1 parent db2c3f9 commit 8cb9d6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .kontinuous/env/dev/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ jobs:
sentry_auth_token:
secretName: www-secret
secretKey: SENTRY_AUTH_TOKEN

app:
env:
- name: "BRANCH_NAME_SLUG"
value: "{{.Values.global.branchSlug32}}"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const ELASTICSEARCH_TOKEN_API: string | undefined =
process.env.ELASTICSEARCH_TOKEN_API;
const ES_INDEX_PREFIX = process.env.ES_INDEX_PREFIX ?? "cdtn";
const CDTN_ADMIN_VERSION = process.env.CDTN_ADMIN_VERSION ?? "v2";
const BRANCH_NAME_SLUG = process.env.BRANCH_NAME_SLUG;

const esClientConfig: ClientOptions = {
node: ELASTICSEARCH_URL,
Expand All @@ -18,5 +19,9 @@ if (ELASTICSEARCH_TOKEN_API) {

export const elasticsearchClient = new Client(esClientConfig);

export const elasticDocumentsIndex = `${ES_INDEX_PREFIX}-${CDTN_ADMIN_VERSION}_documents`;
export const elasticSuggestionsIndex = `${ES_INDEX_PREFIX}-${CDTN_ADMIN_VERSION}_suggestions`;
const prefixIndex = BRANCH_NAME_SLUG?.startsWith("linked")
? `cdtn-${process.env.BRANCH_NAME_SLUG}`
: `${ES_INDEX_PREFIX}-${CDTN_ADMIN_VERSION}`;
console.log(`Prefix index : ${prefixIndex}`);
export const elasticDocumentsIndex = `${prefixIndex}_documents`;
export const elasticSuggestionsIndex = `${prefixIndex}_suggestions`;

0 comments on commit 8cb9d6b

Please sign in to comment.