-
Notifications
You must be signed in to change notification settings - Fork 18
nodeGame Update v7
- status: complete
- version: 7.x
All new releases of nodeGame follow semantic versioning. Your game is guaranteed to run in any non-major new release. Consider the following examples of version changes:
-
From 7.0.0 to 7.0.1 (patch): your game will run fine without changes.
-
From _7.0.x or to 7.1.0 (minor release): your game will run fine without changes, but minor UI modifications are possible, such as the default size of a font inside a widget. Experimental (undocumented) API might also change.
-
From 7.x.y to 7.0.0 (major release): you should test your game carefully and probably update some of its code. For every major release a migration guide is available highlighting all backward-incompatible changes and how to fix your code.
If your game fails to run after a minor or patch update, please report this unexpected behavior immediately.
The fastest way to update nodeGame to the latest version is to use Git. However, you can do so only in the development version of nodeGame.
To check if you can update nodeGame with Git, open a terminal and navigate to the nodeGame installation directory.
If the name of your installation directory ends with -dev
, you will be able to use Git, otherwise you will need to run a new installation and copy over your games. Both methods are explained below.
Download the latest version of the nodeGame installer and run it following these instructions. If you wish, you may install the dev version to enable future Git updates.
After the installation is finished, copy over the games/
and games_available/
folders inside the new nodeGame directory. Important! Check for hard links in the games folder still pointing to the old folder and, in that case, update them accordingly.
If you had special settings in the conf/
directory (e.g., specifying the port), you will also need to manually copy over.
After you have verified that the new installation succeeded, you may delete the old version of nodeGame (in production environments you may also store a copy of the log/
folder).
You can perform the update manually or using the "pull-all" script.
You need to first update the individual nodeGame components and then rebuild the client file.
Navigate to the node_modules/
folder inside the nodeGame installation directory. Enter each of the following sub-directory:
- nodegame-client
- nodegame-server
- nodegame-window
- nodegame-widgets
- nodegame-requirements
- nodegame-game-template
- nodegame-monitor
- JSUS
- NDDB
- nodegame-generator
- nodegame-mturk
- nodegame-db
- nodegame-mongodb
and execute the following git command:
git pull
When you have finished updating all the desired nodeGame components, you need to rebuild the client file nodegame-full.js
. To do so, you need to start nodeGame with the build option (just the first restart):
node launcher.js -b window,widgets,JSUS,NDDB
There is no need to specify other components, because they are either automatically included in every new build or not sent to the client at all.
If you wish, you can just update some components. For example, if you just updated the widgets, you just need to rebuild the widgets at the next restart.
node launcher.js -b widgets
The manual update will fail if you have made any changes to the source code inside a component. For instance, every new build (-b option
) modifies the source code of one or more component. If the changes can be discarded, you can reset the individual components before pulling the new changes:
git reset --hard
git pull
If you want to keep your changes, you need to commit them first.
git add .
git commit -m "my important changes"
git pull
However, this may cause a conflict with the next update of nodeGame, which needs to be resolved manually.
This script automatizes the manual update process.
Right-click and save it inside the nodeGame installation directory.
Open a terminal (in Windows Git Bash) and execute:
chmod +x pull-all.sh
./pull-all.sh
Following completion of the update, you need to rebuild the client file following the procedure outlined above.
Notice: the script is very basic and does not handle failures, such as: git repositories not available, or source codes modified.
Go back to the wiki Home.
Copyright (C) 2021 Stefano Balietti
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.