From 00a4bf7155c14263a5bfaf033503b8ebdf91981c Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 24 Jun 2020 15:28:57 -0400 Subject: [PATCH] Tweak algolia scripts Avoid running algolia job in forks or enterprise private repositories --- .circleci/config.yml | 11 +++++++---- .circleci/config/jobs/algolia_index.yml | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dfbe78a7f..ab883dee4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: diff --git a/.circleci/config/jobs/algolia_index.yml b/.circleci/config/jobs/algolia_index.yml index 889e87abc..a725bd853 100644 --- a/.circleci/config/jobs/algolia_index.yml +++ b/.circleci/config/jobs/algolia_index.yml @@ -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