This repository contains metadata for maps used in Beyond All Reason game.
It contains files that work as source of truth that is then used by different components in the BAR infrastructure, and build scripts that manipulate and validate that information.
For more convenient data input, the source of truth resigning in map_list.yaml
file is actually automatically generated by data export from BAR's
Rowy instance: https://rowy.beyondallreason.dev/.
See scripts/js/src/update_from_rowy.ts.
Mostly, you modify the source of truth files, commit via pull request and it gets deployed via GitHub Actions workflow.
When you are changing scripts, it's useful to be able to regenerate files manually and check if all is working correctly. It's possible to do it in two different ways:
- directly (Linux or in WSL): preferred for development as editor has an easy access to everything
- inside a Docker container: primarily for hermetic testing
Make sure you have python, curl, Node.js and unzip installed (see Dockerfile for the full list of dependencies), and then run install script to setup an isolated environment for the development.
./scripts/install.sh
Create a copy of the environment variables file
cp .env.example .env
For testing some scripts that push data to external services, setting env variables in the .env might be necessary. Values must be obtained from the corresponding team for the need (TEIServer, Webflow, etc.)
source .envrc
Hint: .envrc is a direnv compatible file.
To make sure that your editor is correctly resolving all types (e.g. generate TypeScript type definitions from JSON Schema), make sure to run
make types
Build image with current version of the code, it does basically what steps above but in a docker container.
docker build . -t maps-metadata-build
Get into the docker container shell
docker run -it --rm maps-metadata-build
Note: if you later need to copy some files out of the docker container, read
about docker cp.
Instead of building an image and copying files out of the container (as well as doing any editing within that container), you can mount the repository directory as a volume. This way, any changes you make on your host machine will be reflected inside the container, and you can easily access generated files.
docker run -it --rm -v $(pwd):/build maps-metadata-build
Windows (powershell):
docker run -it --rm -v ${PWD}:/build maps-metadata-build
Generation of output files is done using Makefile, so run
make -j $(nproc)
to regenerate all files in the gen/ directory, and then
make -j $(nproc) test
to run additional checks on them.
To cleanup generated files, simply run make clean.
See GitHub wiki for more documentation.