Goal:
We are going to create new git repository and configure your server (Droplet) to run Parse Server.
Expected result:
Your repository will contain server configuration. Server environment (pythons packages, docker containers) will be deployed on your Droplet. Parse Server, Mongo and Dashboard will be working on server.
- Create DO droplet (
Ubuntu 16.04 x64), launch it, and get ip
- You need to prepare client certificate, please read Prepare chains of certs
- Prepare DNS name in your DNS account with ip from previous step
Script is a thing that will deploy everything on server.
- Run first script, you need prepared staging password and folder with client's ssl
./scripts/init-new-project.sh- Add your remote origin url to parse server project
git remote add origin ssh://git@github.com:your-project.git- Edit inventories files, set ip for server
nano inventories/staging
nano inventories/production- Edit common config
nano group_vars/all.yml- Edit staging/production config
nano group_vars/staging.yml
nano group_vars/production.yml-
Edit
newrelic.jsin the root folder with correctapp_name -
Edit
package.jsonin the root folder with correct npm versions -
Commit and push to remote git
- Run ansible init script for setup staging/production
# for staging
ansible-playbook -i inventories/staging init.yml --ask-vault-pass --extra-vars "ansible_port=22 drop_database=true"# for production
ansible-playbook -i inventories/production init.yml --ask-vault-pass --extra-vars "ansible_port=22 drop_database=true"Where:
-i inventories/production.ymluse specific inventory file with ip--ask-vault-passuse for staging/production password asking--extra-vars "ansible_port=22"use env ansible_port=22drop_database=truewill drop whole MongoDb; it's required if you want to migrate database from Parse.
This script will use your configuration files and setup everything on server.
Smth like this: "WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)!".
No worries. Server's ssh key was changed. All you need to do is to remove server's ip from known_hosts file.
open ~/.ssh/known_hostsand remove server's ip (probably the last row).
- migrate MongoDB
- make sure that server's code is working
- setup monitoring