Tweak algolia scripts

Avoid running algolia job in forks or enterprise private repositories
This commit is contained in:
Mahmood Ali
2020-06-24 15:28:57 -04:00
parent d1bfbe2332
commit 00a4bf7155
2 changed files with 14 additions and 8 deletions

11
.circleci/config.yml generated
View File

@@ -1050,15 +1050,18 @@ jobs:
- PAGER: cat
algolia_index:
docker:
- image: circleci/buildpack-deps
shell: /usr/bin/env bash -euo pipefail -c
- image: node:10
steps:
- checkout
- setup_remote_docker
- run:
command: |
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/nomad.git" ]; then
echo "Not Nomad OSS Repo, not indexing Algolia"
exit 0
fi
cd website/
npm i
npm install
node scripts/index_search_content.js
name: Push content to Algolia Index
test-docker:

View File

@@ -1,12 +1,15 @@
docker:
- image: circleci/buildpack-deps
shell: /usr/bin/env bash -euo pipefail -c
- image: node:10
steps:
- checkout
- setup_remote_docker
- run:
name: Push content to Algolia Index
command: |
if [ "$CIRCLE_REPOSITORY_URL" != "git@github.com:hashicorp/nomad.git" ]; then
echo "Not Nomad OSS Repo, not indexing Algolia"
exit 0
fi
cd website/
npm i
npm install
node scripts/index_search_content.js