Tools for educandu development and maintenance.
- node.js ^18.0.0
- Docker
- optional: globally installed gulp:
npm i -g gulp-cli
This repository contains scripts for local usage, it does not create any build output.
copy-data
Drops all destination data (mongoDB and S3) and replaces it with the source data. Optionally anonymizes all sensitive user information, replacing it with mock data.dump-db
Creates a mongodump of the MongoDb database locally in./dump/<nameOfDatabase>
prune-env
Drops all data (mongoDB and S3) from the specified environment
Variable | Description | Required by tools |
---|---|---|
S3_ENDPOINT_[ENV] | The S3 entrypoint for ENV (e.g. 'https://s3.eu-central-1.amazonaws.com') |
copy-data prune-env |
S3_REGION_[ENV] | The S3 region for ENV (e.g. 'eu-central-1') |
copy-data prune-env |
S3_ACCESS_KEY_[ENV] | The S3 access key of the auth credentials for ENV | copy-data prune-env |
S3_SECRET_KEY_[ENV] | The S3 secret key of the auth credentials for ENV | copy-data prune-env |
S3_BUCKET_NAME_[ENV] | S3 bucket name for ENV | copy-data dump-db prune-env |
DB_URI_[ENV] | MongoDB URI for ENV. (e.g. format: mongodb+srv://[user]:[pass]@[host]/[name] ) |
copy-data dump-db prune-env |
DB_NAME_[ENV] | MongoDB database name for ENV | copy-data dump-db prune-env |
Example for copying data from staging to integration:
$ export DB_URI_INT='mongodb+srv://user:fjdshf87dsV@int.mongodb.net/name'
$ export DB_NAME_INT='int.database'
$ export S3_ENDPOINT_INT='https://s3.eu-central-1.amazonaws.com'
$ export S3_REGION_INT='eu-central-1'
$ export S3_ACCESS_KEY_INT='DSJHFDKSJFHERWUFRUKRF'
$ export S3_SECRET_KEY_INT='DFLJKDSDFDS8FDF7DS/DSFLKFJDSLKFDJDJLF8+e'
$ export S3_BUCKET_NAME_INT='int.bucket.name'
$ export DB_URI_STAG='mongodb+srv://user:8798437432@stag.mongodb.net/name'
$ export DB_NAME_STAG='stag.database'
$ export S3_ENDPOINT_STAG='https://s3.eu-central-1.amazonaws.com'
$ export S3_REGION_STAG='eu-central-1'
$ export S3_ACCESS_KEY_STAG='DSJHFDKSJFHERWUFRUKRF'
$ export S3_SECRET_KEY_STAG='DFLJKDSDFDS8FDF7DS/DSFLKFJDSLKFDJDJLF8+e'
$ export S3_BUCKET_NAME_STAG='stag.bucket.name'
$ ./copy-data -from STAG -to INT -anonymize -skiplarge
The -anonymize
flag is optional and setting it will anonymize all users in the DB.
The -skiplarge
flag is optional and setting it will skip copying CDN data larger than 2 Mb.
$ export DB_URI_INT='mongodb+srv://user:fjdshf87dsV@int.mongodb.net/name'
$ export DB_NAME_INT='int.database'
$ ./dump-db -from INT
Example for deleting all data from integration:
$ export DB_URI_INT='mongodb+srv://user:fjdshf87dsV@int.mongodb.net/name'
$ export DB_NAME_INT='int.database'
$ export S3_ENDPOINT_INT='https://s3.eu-central-1.amazonaws.com'
$ export S3_REGION_INT='eu-central-1'
$ export S3_ACCESS_KEY_INT='DSJHFDKSJFHERWUFRUKRF'
$ export S3_SECRET_KEY_INT='DFLJKDSDFDS8FDF7DS/DSFLKFJDSLKFDJDJLF8+e'
$ export S3_BUCKET_NAME_INT='int.bucket.name'
$ ./prune-env -on INT
Funded by 'Stiftung Innovation in der Hochschullehre'
A Project of the 'Hochschule für Musik und Theater München' (University for Music and Performing Arts)
Project owner: Hochschule für Musik und Theater München
Project management: Ulrich Kaiser