Skip to content

Saral Backend Server Setup

Dileep Gadiraju edited this page Nov 8, 2021 · 5 revisions

Dev server Data Import

  1. ssh [email protected]
  2. sudo su
  3. docker ps
  4. docker exec -it <container ID> bash
  5. docker service update saralpoc_gateway --force
  6. ssh -i <key> [email protected] -L 27017:server1.example.com:27017
  7. ssh user@localhost -N -f -L 27017:saral-dev-api.anuvaad.org:27017
  8. Commands to upload files: scp <files> [email protected]:/home/ubuntu

Reload latest data into Dev Server

docker exec -it $(docker ps -aqf "name=^saralpoc_saral-backend") node ./data/import-data.js --delete

docker exec -it $(docker ps -aqf "name=^saralpoc_saral-backend") node ./data/import-data.js --import

CICD for Build and Deploy

  1. Trigger below build to publish latest image to docker hub. Change Image or tag name as needed.

https://jenkins.idc.tarento.com/job/Saral/job/saral-backend/

  1. Feed Image name with tag (say saral-backend:1.0-latest) for below dev server deployment.

Note: This job has the option to reload saral reference data into the backend database.

https://jenkins.idc.tarento.com/job/Saral/job/deploy-to-poc/

Backend APIs

http://saral-xxx-api.anuvaad.org:3005

https://saral-xxx-api.anuvaad.org

Public Certificates Setup on Developers Machine

manually-generating-your-ssh-key-in-mac-os-x

Generate-ssh-key-windows-10

Server availability Check

curl -d '{"schoolId": "1","password": "tarento@123","classes": true}' -H 'Content-Type: application/json' http://saral-dev-api.anuvaad.org:3005/schools/login

curl -d '{"schoolId": "1","password": "tarento@123","classes": true}' -H 'Content-Type: application/json' https://saral-dev-api.anuvaad.org:3005/schools/login

Clone this wiki locally