- QA : coast-to-coast-qa (will change to match other naming schemes)
- RC : md-mongo-rc
- md-socket-server-qa
- md-server-qa
- md-admin (see andrew)
- md-client (see andrew)
- md-socket-server-rc
- md-server-rc
- md-admin-rc
- md-client (see andrew)
When deploying any of the clients to RC, please review the deploy.sh
file to get a better understanding as to what specific ENV_VARS
are needed.
See andrew if you have any questions.
Run EAZE_GIT_PASSWORD=yourpwhereplease NODE_ENV=RC ./deploy.sh
For md-client, you must specific doctor / patient through the ENV_VAR 'APP' (APP=doctor).
For md-admin, you should just be able to run the aforementioned.
Any code pushed to master will end up on the QA URL's! Please QA before pushing to RC, and communicate with everyone in slack before and after producing an RC.
In order to deploy the md-server / md-socket-server to RC
, one must simply push to the aptible-rc remote.
To find the remotes
- go into the aptible dashboard -> coast-to-coast-qa -> and find md-server-rc / md-socket-server-rc
- add remote by:
git remote add aptibleRC git@whatever.aptible.com:somethingfromthedashboard.git
git push aptibleRC master --force
QA Deployment is automagically done through circle. Just push to the master branch, and if you have some nice tests - you get a nice QA.
Inside of md-server you'll find a migrations folder.
Just run node ./node_modules/.bin/mongo-migrate -runmm create patients-add-email
to create the patients-add-email migration.
Please keep the naming schema to model-action-property
Up
refers to the introduction of something new to the schema, or a change. Please try to make a file per change per property!
Down
refers to a revert (you make janky migration, define down to go back to the previous state). Define the exact opposite of what up
tries to accomplish.
Important
There's a default-config.json that specifies the DB which the migrations will act upon.
Make sure you define it per your db you're operating on. All the information like host, pw, etc can be found on aptible.
Example, you tunnel to an aptible db through aptible db:tunnel md-mongo-rc
and it assigned you port 12345
your config should look like:
{
mongoAppDb: {
host: 'localhost',
port: '12345',
username: 'whatever is in aptible',
password: 'whatever is in aptible'
}
}
For up: node ./\node_modules/\mongodb-migrate -runmm up
(or npm run migrate)
For down: node ./\node_modules/\mongodb-migrate -runmm down
For any other migration questions, refer to mongo-migrate
Cloning DB's The easiest / most sane way of replicating a db is through cloning.
- Must first have a
destination
and asource
. - start
mongo
in yourdestination
- enter
db.copyDatabase('the source db name', 'the destination db name', 'ip of source': 'port of source', 'password', 'MONGODB-CR')
Example
This copies db
from 127.0.0.1:63488
and places it locally under the testing
name
db.copyDatabase('db', 'testing', '127.0.0.1:63448', 'aptible', 'passwords are fun when you share with everyone', 'MONGODB-CR')
EXPORTING JSON FILES (When the above doesn't work) Have your aptible tunnel running...
Export the doctors table by:
mongoexport --host 127.0.0.1:APTIBLEPORT --username aptible --password 'SOMEPASSWORD --authenticationDatabase db --collection doctors --db db --out doctors.json
IMPORT JSON FILES
Have mongodb running locally, make sure you arent connected to aptible
Import a doctor table
doctors.json```
You can also run the above on any non-local db by specifiying a host, port, username, and password.
***All table names must be pluralized***