eSaude Continuous Integration
Note: We are currently only using the described continuous integration process for our POC product.
In order to promote good code quality, every time code is merged into master, we run through the continuous integration pipeline pictured above.
We use Codacy for code quality analysis and a dashboard showing a summary of the current quality of our code can be found at https://www.codacy.com/app/esaude/esaude-esaude-emr-poc/dashboard.
We use Travis CI as our continuous integration tool and the latest build result can always be found at https://travis-ci.org/esaude/esaude-emr-poc.
The build will fail if any of the steps in the CI pipeline fails.
Codacy code quality analysis is invoked when a PR is created or when a commit is made directly to master. Right now we are checking our code against the default Codacy code patterns, but when the community establishes its own coding style guidelines, we should configure Codacy to check against these guidelines.
Once Travis detects that new code has been merged into the master branch, it begins the build and deploy pipeline execution by spinning up a Docker container, installing the , and running:
npm install -g bower grunt-cli codacy-coverage coveralls
bower install --force-latest
This sets up the required eSaude EMR POC development environment.
Once the development environment has been prepared, the tests are run by executing:
This phase builds a deployable packaged archive from the latest code in master:
The result is a zip file called esaude-emr-poc-master.zip.
The deploy phase has two steps and will only be invoked when code is merged into master and not when a PR is created.
First, the distributable archive is uploaded to , our binary hosting service using . This is necessary in order to make the latest build from master publicly available so that we can use it to build the Docker containers in our dev test environment.
Next we do a clean deploy of the latest build using the . This script first destroys any existing containers and images on the dev test server, then creates the POC Docker image from scratch using the . As part of this process, the latest are pulled from Bintray.
Finally, we initialise the database container with a clean database, then start up all the containers. The system running with the latest code will be available at http://dev.esaude.org after two or three minutes once the containers start up.
This phase reports the code coverage metrics to Codacy and by running:
cat coverage/**/lcov.info | codacy-coverage
cat coverage/**/lcov.info | coveralls