Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

welcoming robots in certain situations #613

Merged
merged 15 commits into from
Nov 10, 2021
Merged
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ parameters:
type: string
dev_git_branch: # change to feature branch to test deployment
description: "Name of github branch that will deploy to dev"
default: "js-fix-plotly-import"
default: "TTAHUB276"
type: string
sandbox_git_branch: # change to feature branch to test deployment
default: "kw-delete-reports-script"
default: "TTAHUB276"
type: string
prod_new_relic_app_id:
default: "877570491"
Expand Down Expand Up @@ -333,6 +333,15 @@ jobs:
- run:
name: Build backend assets
command: yarn build
- when:
condition:
and:
- equal: [<< pipeline.project.git_url >>, << pipeline.parameters.prod_git_url >>]
- equal: [<< pipeline.git.branch >>, << pipeline.parameters.prod_git_branch >>]
steps:
- run:
name: Create production robot
command: ./bin/robot-factory
- run:
name: Build frontend assets
command: yarn --cwd frontend run build
Expand Down
9 changes: 9 additions & 0 deletions bin/robot-factory
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

echo 'Setting site to be indexable in robots.txt'

cat >frontend/public/robots.txt <<EOL
# Welcome Robots
User-agent: *
Disallow:
EOL
5 changes: 4 additions & 1 deletion frontend/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# we disallow everything by default
# in production, we allow indexing by removing the slash from the disallow

# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
Disallow: /