This repository contains the scripts to generate the csv & json files for the openSenseMap Archive.
This is a Node.js project.
You will need to have Node.js (at least >= 18) and npm or yarn installed. Also you need Docker and Docker Compose installed.
- Clone the repository
git clone [email protected]:sensebox/openSenseMap-archive.git- Install NPM packages
npm install- Create the
.envfile
cp .env.example .env-
Enter der environmental variables in
.env -
Spin up the local database
docker-compose up -d dbTo seed the database with boxes and measurements, copy the archive files created by
mongodumpto thedumpsfolder. The boxes dump should be named boxes and the measurement dump should be named measurements The folder is mounted to the MongoDB container and will seed the data on start up.
- Run the archiver (locally)
npm run create-archive- Run the archiver (Docker)
docker build -t osem-archiver .
docker-compose up -dFor this option skip point 5 and just copy the dumps as explained.
The archive files should be generated by default inside the archive folder.
The releasing workflow includes some manual steps. Please follow these steps:
A new release is created on the
mainbranch.
- Commit all you changes
- Run
npm version major | minor | patchhttps://docs.npmjs.com/cli/v8/commands/npm-version - Run
git push --tags origin main - Draft a new release on https://github.com/openSenseMap/archive/releases/new
- Use the new pushed tag under
Choose a tag - Set the release title to
vx.x.x(e.g.v1.0.1) - Use the Generate release notes function
- Finally click Publish release
- Use the new pushed tag under
Contains scripts to initialize the used MongoDB database for development purposes. Are just used within the docker-compose.yml file and mounted to the db service.
Contains systemd service and timer files to run the archiver as a systemd service. The archive-checker.service uses the check-container.sh utility.
Containes two utility scripts to check container status and wait for specific services on a tcp host/port.
wait-for-it.sh: is used within the the Docker image https://github.com/vishnubob/wait-for-itcheck-container.sh: checks if the archiver is running and is used in the systemd service