Skip to content

Deploying web version

Alexandre Henrique Afonso Campos edited this page May 6, 2024 · 2 revisions

We are not deploying the web version is CICD for now, so the deployment should be done manually.

Backend

The official jar, that can be downloaded from the WCA website, is used as backend. We also deploy the frontend separately so we can change URLs without affecting the official jar (which run usually on localhost:2014).

  • Build a docker TNoodle docker version.

You can build the docker version directly or by using the official jar version and the Dockerfile

FROM adoptopenjdk/openjdk11:latest
COPY TNoodle-WCA-1.2.2.jar app.jar
ENTRYPOINT [ "java", "-jar", "/app.jar", "--nobrowser", "--noiconbar" ]

Remember to replace the version correctly. Also, you should be in the same folder as the downloaded TNoodle version.

  • Push the image to ECR. You can get instructions from the TNoodle ECR.

  • Restart the TNoodle ECS task.

Frontend

Deploy the frontend separately. The jar is used only as backend. We deploy a new frontend in which we fully control the URLs. Changing the official jar is more difficult because you would need to sign it. This is an easier version.

  • Replace URLs. You should navigate to the client folder and

    • Change homepage to https://tnoodle.worldcubeassociation.org in the file client/package.json

    • Change backendUrl to new URL("https://tnoodle.worldcubeassociation.org") in the file client/src/main/api/tnoodle.api.ts

cd client
nvm use 14 # or `nvm install 14` 
yarn install
yarn build
  • Get the variables value from the actions configurations in this repo. You will need CF_DISTRIBUTION_ID and DEPLOYMENT_BUCKET. Export them with the same name in your local terminal.

  • In the client folder, after running the build command (it created the build folder), run

aws configure set preview.cloudfront true
aws s3 sync build s3://$DEPLOYMENT_BUCKET --delete
aws cloudfront create-invalidation --distribution-id $CF_DISTRIBUTION_ID --paths /\*
Clone this wiki locally