Updated 2024-03-13
If you want to install your own instance of the GUI client (for Option C):
cd ~/w2020 mkdir client cd client/ git init git remote add origin https://github.com/RuleGame/RuleGame.git git pull origin master
Variable name | Variable value | Comments |
---|---|---|
REACT_APP_DEBUG_MODE_ENABLED | true or false | Use true if compiling the production version of the client, or false for the development version (which will show more debugging information) |
REACT_APP_APP_API_HOST_ORIGIN | The Game Server URL | E.g. http://myhost.come/w2020 (if your server runs on that host on port 80), or http://localhost:8080/w2020 (if, for testing purposes, you have installed the server on your laptop, and only plan to access it from the web browser running on the same laptop) |
setenv REACT_APP_DEBUG_MODE_ENABLED false setenv REACT_APP_APP_API_HOST_ORIGIN http://rulegame.wisc.edu/w2020
sudo -u tomcat mkdir /opt/tomcat/webapps/rule-game sudo -u tomcat cp -pa build /opt/tomcat/webapps/rule-game/prodThe directory location within the Tomcat webapps dir should, of course, correspond to the URLs you have specified for GUI_PROD and GUI_DEV in your Master config file.
#!/bin/bash pull origin master mkdir rule-game export REACT_APP_APP_API_HOST_ORIGIN=/w2020 export REACT_APP_DEBUG_MODE_ENABLED=false npm install npm run build mv build prod mv prod rule-game export REACT_APP_DEBUG_MODE_ENABLED=true npm install npm run build mv build dev mv dev rule-game (cd rule-game; jar cvf rule-game.war prod/* dev/*) sudo -u tomcat cp rule-game/rule-game.war /opt/tomcat/webapps
Here we build both the production and development versions of the client, and package them into a single WAR file for deploying to your Tomcat server (where it will show at http://your-host-name/rule-game).
The setting of REACT_APP_APP_API_HOST_ORIGIN used in the script above is suitable if you are going to use your instance of client with one instance of the Rule Game server, the one that you deploy to /w2020 on your host.
#!/bin/csh mkdir rule-game setenv REACT_APP_APP_API_HOST_ORIGIN /w2020 setenv REACT_APP_DEBUG_MODE_ENABLED false npm install npm run build mv build prod mv prod rule-game setenv REACT_APP_DEBUG_MODE_ENABLED true npm install npm run build mv build dev mv dev rule-game cd rule-game jar cf rule-game.war prod dev
If you know TypeScript, you can modify the client's source code as needed before compiling.
When our team updates the client code in its GitHub repository, you can rebuild and reinstall the updated client (prod version) using a script like this:
[MAIN] [SETUP]