Deployment¶
Git Branches¶
The code for the frontend, backend and documentation is stored in the same git repository. There are currently two branches, development and master for everything. Any code commited & pushed to the development branch will be propagated to the development sites and likewise for the master branch will be pushed to the production sites.

Git Flow (How i’ve been doing it)¶
Create feature branch from the development
Commit changes to feature branch
Merge latest changes from development into feature branch
Merge changes into the development branch
Merge changes into the master branch
git checkout development git branch feature_branch git commit -am "Some changes" git merge development git checkout development git merge feature_branch
Continuous Integration Server¶
The deployment of new code to the development and production servers is managed by the continuous integration server, Jenkins. At the moment, all it does is pull the latest code and install new modules on the development or production server. It also restarts the apache wsgi server and celery task queues with the new code. It would also be a good place for unit and integration tests.
You can access the jenkins server here:
http://jenkins.dectechsports.com/

Jenkins Jobs¶
- Backend - Git Pull : Pulls the latest code from the master git branch on the backend server in /mtn/portws-drive/portalws_<branch>/portal
- Backend - Pip Install : Reads /portal/code/backend/requirements.txt and installs any new modules.
- Backend - Restart Celery Workers : Restarts the celery task queues and workers with the latest code.
- Backend - Restart WSGI Server : Touches /portal/code/backend/fb_api/wsgi.py so that apache’s wsgi picks up the latest code.
- Backend - Start Celery Beat : Starts the celery task scheduler. Needs to be running in background to init scheduled tasks at the right time.
- Backend - Start Flower : Browser based program used to monitor the progress of tasks, task queues and workers.
- Frontend – Deploy : – Pulls the latest code from the development git branch on the frontend server in /home/portal_<branch>/portal.