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 all 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
7 changes: 4 additions & 3 deletions {{cookiecutter.project_dirname}}/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,11 @@ can-i-deploy_production:
script:
- >
docker build
--tag=${CI_REGISTRY}/${CI_PROJECT_PATH}:${VERSION_REF}
--build-arg REACT_ENVIRONMENT=${CI_ENVIRONMENT_NAME}
--file=docker/remote.Dockerfile
--target=remote
--pull .
--pull
--tag=${CI_REGISTRY}/${CI_PROJECT_PATH}:${VERSION_REF}
--target=remote .
- docker push ${CI_REGISTRY}/${CI_PROJECT_PATH}:${VERSION_REF}
after_script:
- docker logout ${CI_REGISTRY}
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_dirname}}/docker/local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ WORKDIR $WORKDIR
RUN chown $USER_ID:$GROUP_ID $WORKDIR
USER $USER_ID:$GROUP_ID
ENTRYPOINT ["./scripts/entrypoint.sh"]
CMD yarn start
CMD yarn dev
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CMD yarn dev
CMD yarn start

LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="frontend" stage="local"
7 changes: 5 additions & 2 deletions {{cookiecutter.project_dirname}}/docker/remote.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ 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", "./"]
COPY ["next.config.js", "package.json", "sentry.client.config.js", "sentry.server.config.js", "yarn.lock", "./"]
COPY ["public/", "public/"]
COPY --from=build --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=build --chown=nextjs:nodejs /app/.next/static ./.next/static
ARG SENTRY_AUTH_TOKEN \
ARG REACT_ENVIRONMENT \
SENTRY_AUTH_TOKEN \
SENTRY_ORG \
SENTRY_PROJECT_NAME \
SENTRY_URL
Expand All @@ -48,5 +49,7 @@ ENV NEXT_TELEMETRY_DISABLED=1 \
SENTRY_ORG=$SENTRY_ORG \
SENTRY_PROJECT_NAME=$SENTRY_PROJECT_NAME \
SENTRY_URL=$SENTRY_URL
COPY ./public/robots/${REACT_ENVIRONMENT}.txt ./public/robots.txt
RUN rm -rf public/robots/
CMD yarn start
LABEL company="20tab" project="{{ cookiecutter.project_slug }}" service="frontend" stage="remote"
5 changes: 2 additions & 3 deletions {{cookiecutter.project_dirname}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"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",
"start": "next start",
"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 +29,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