Show the user a version string which identifies the version of the client code they are running. We don't need to know what version the database or server is running, so any kind of collection or method approach would fail because it will automatically update all clients. We want something hard coded into the client code, yet generated dynamically at build (deploy) time.
We create a template called version
which we include in a remote corner of the UI. As part of our deployment process we put the last git commit hash into that file.
We use npm to start our meteor apps like npm start
. That means we can ensure that all devs have a local copy of the version.html
template.
The deploy.sh
script below lives in the same folder as our mup config.
The version.html
file is ignored by git so we never get it into our repo. We have a .gitignore
file in app/client/templates/shared/
with a line version.html
to exclude that file from git.