Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2022-12-15 12:24:05 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2022-12-15 12:24:05 +0300
commit4b946c3679f6e7811c657bbf8eabfeaf29cdc368 (patch)
tree7b4d9bf55e16ab12c6d7a7a3643c671f283586a2
parent2998611b19cf345848370416b6737ffb66935e69 (diff)
Revert "Merge branch 'sarahg/algolia-review-apps' into 'main'"
This reverts merge request !3359
-rw-r--r--.gitlab/ci/build-and-deploy.gitlab-ci.yml4
-rw-r--r--content/frontend/default/environment.js4
-rw-r--r--content/frontend/search/search.js33
3 files changed, 19 insertions, 22 deletions
diff --git a/.gitlab/ci/build-and-deploy.gitlab-ci.yml b/.gitlab/ci/build-and-deploy.gitlab-ci.yml
index a2a90fb4..ce41b369 100644
--- a/.gitlab/ci/build-and-deploy.gitlab-ci.yml
+++ b/.gitlab/ci/build-and-deploy.gitlab-ci.yml
@@ -77,10 +77,6 @@ compile_dev:
- .build_base
variables:
ALGOLIA_SEARCH: 'false'
- rules:
- - if: $CI_COMMIT_REF_NAME =~ /algolia/
- variables:
- ALGOLIA_SEARCH: 'true'
script:
- !reference [".compile-and-minify-scripts", "script"]
- !reference [".gzip-scripts", "script"]
diff --git a/content/frontend/default/environment.js b/content/frontend/default/environment.js
index e09a83c4..8d530ded 100644
--- a/content/frontend/default/environment.js
+++ b/content/frontend/default/environment.js
@@ -28,7 +28,3 @@ export function isGitLabHosted() {
export function isArchivesSite() {
return window.location.host === GlHosts.find((x) => x.environment === 'archives').host;
}
-
-export function isProduction() {
- return window.location.host === GlHosts.find((x) => x.environment === 'production').host;
-}
diff --git a/content/frontend/search/search.js b/content/frontend/search/search.js
index ea98f6e3..b0132354 100644
--- a/content/frontend/search/search.js
+++ b/content/frontend/search/search.js
@@ -1,25 +1,30 @@
-import { isProduction } from '../default/environment';
-
/**
- * Loads Algolia connection info.
- *
- * For production, we use the "gitlab" index.
- * All other environments use the "gitlab_testing" index.
- * Both indexes use the same credentials to connect.
- *
- * @see https://www.algolia.com/apps/3PNCFOU757/indices
+ * Functions used by both DocSearch and InstantSearch.
*/
-export const getAlgoliaCredentials = () => {
- return {
+
+export const algoliaAccounts = {
+ production: {
apiKey: 'eef4ee4af5ab6b0d76d1a2f9fc4fab58',
appId: '3PNCFOU757',
- index: isProduction() ? 'gitlab' : 'gitlab_testing',
- };
+ index: 'gitlab',
+ },
+ testing: {
+ apiKey: 'eef4ee4af5ab6b0d76d1a2f9fc4fab58',
+ appId: '3PNCFOU757',
+ index: 'gitlab_testing',
+ },
};
/**
- * Returns the site version from the docsearch:version metatag.
+ * Loads Algolia connection info for a given Crawler.
+ *
+ * Set the crawler default to 'testing' in order to use
+ * the gitlab_testing index. (Don't forget to change it back!)
*/
+export const getAlgoliaCredentials = (crawler = 'production') => {
+ return algoliaAccounts[crawler];
+};
+
export const getDocsVersion = () => {
let docsVersion = 'main';
if (