The build will fail if any of the steps in the CI pipeline fails.
Quality Phase
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.
Prepare Phase
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 specified version of node, and running:
This sets up the required eSaude EMR POC development environment.
Test Phase
Once the development environment has been prepared, the tests are run by executing:
grunt test
Package Phase
This phase builds a deployable packaged archive from the latest code in master:
grunt build:package
The result is a zip file called esaude-emr-poc-master.zip.
Deploy Phase
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 Bintray, our binary hosting service using Travis’ Bintray deployment provider. 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 dev server deploy script. This script first destroys any existing containers and images on the dev test server, then creates the POC Docker image from scratch using the Docker and docker-compose scripts. As part of this process, the latest platform docker images 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.
Report Phase
This phase reports the code coverage metrics to Codacy and Coveralls by running:
Quality Phase
Prepare Phase
npm install -g bower grunt-cli codacy-coverage coveralls
npm install
bower install --force-latest
Test Phase
grunt test
Package Phase
grunt build:package
Deploy Phase
Report Phase
cat coverage/**/lcov.info | codacy-coverage
cat coverage/**/lcov.info | coveralls