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

TG-1126 Maintenance - Generate a robot.txt per environment at build time #41

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions {{cookiecutter.project_dirname}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ can-i-deploy_production:
image: docker:20
services:
- docker:20-dind
variables:
- REACT_ENVIRONMENT: ${CI_ENVIRONMENT_NAME}
before_script:
- export DOCKER_CONFIG=${PWD}/.dockerconfig
- docker login --username "${CI_REGISTRY_USER}" --password "${CI_REGISTRY_PASSWORD}" "${CI_REGISTRY}"
Expand All @@ -266,6 +268,7 @@ can-i-deploy_production:
docker build
--tag=${CI_REGISTRY}/${CI_PROJECT_PATH}:${VERSION_REF}
--file=docker/remote.Dockerfile
--args-${CI_ENVIRONMENT_NAME}
--target=remote
--pull .
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}:${VERSION_REF}
Expand Down
5 changes: 4 additions & 1 deletion {{cookiecutter.project_dirname}}/docker/remote.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
USER nextjs
COPY ["next.config.js", "package.json", "sentry.client.config.js", "sentry.server.config.js", "server.js", "yarn.lock", "./"]
ARG REACT_ENVIRONMENT
COPY ["next.config.js", "package.json", "sentry.client.config.js", "sentry.server.config.js", "yarn.lock", "./"]
COPY ["public/", "public/"]
COPY ./public/robots/${REACT_ENVIRONMENT}.txt ./public/robots.txt
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
RUN rm -rf public/robots/
ARG SENTRY_AUTH_TOKEN \
SENTRY_ORG \
SENTRY_PROJECT_NAME \
Expand Down
4 changes: 1 addition & 3 deletions {{cookiecutter.project_dirname}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@
"ci:unit-test": "npx jest --color --silent --detectOpenHandles --testPathIgnorePatterns=pact/contracts --coverage --coverageDirectory ./coverage/tests --ci --reporters=default --reporters=jest-junit",
"e2e": "CYPRESS_BASE_URL=http://localhost:3000 cypress open",
"lint": "next lint",
"dev": "next dev",
"pact": "npx jest pact/contracts --testEnvironment=node --detectOpenHandles",
"start": "node server.js",
"test": "npx jest --testPathIgnorePatterns=pact/contracts --detectOpenHandles"
},
"dependencies": {
"@next/font": "^13.4.19",
"@sentry/nextjs": "^7.64.0",
"basic-auth": "^2.0.1",
"express": "^4.18.2",
"next": "^13.4.19",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand All @@ -29,7 +28,6 @@
"@testing-library/jest-dom": "^6.1.3",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/express": "^4.17.17",
"@types/jest": "^29.2.5",
"@types/node": "^20.5.3",
"@types/react": "^18.2.21",
Expand Down
31 changes: 0 additions & 31 deletions {{cookiecutter.project_dirname}}/server.js

This file was deleted.

Loading