The Continuous Deployment Pipeline on Jenkins

SmartMirror Pipeline on Jenkins
Modes of execution
The SmartMirror pipeline is parameterized. It can be run in three different modes:
Mode | Explanation |
---|---|
Test | Only executes the test related steps of the pipeline, such as Test, Cucumber tests. This allows us to run our integration tests quickly, without deploying the app. |
Deploy | Only executes the deployment related steps of the pipeline, such as Deploy to Artifactoy, Deploy back-end, Deploy Doctor App and Deploy on runtime. This allows us to deploy the app while skipping all tests. |
Test+Deploy | Executes the full pipeline. |
Details on each stage
Used plugins, executed tasks, used tools
Stage | Purpose | Used tools | Runs on modes |
---|---|---|---|
Test | This steps executes some preliminary testing, such as checking if the remote runtime server is active. This is so the new build stops before executing some of the most performance heavy steps in case there’s something wrong with the deployment server. | SSH command | Test + Deploy Test |
Deploy to Artifactory | On this step, the main smart mirror app is built and deployed to artifactory, configured on the settings.xml file. | Maven |
Test + Deploy Deploy |
Deploy back-end | Builds a docker image containing our emotion detection program and pushes it to the docker registry | Docker |
Test + Deploy Deploy |
Deploy Doctor App | Builds the doctor app and the corresponding docker image. It pushes the image to the docker registry. | Docker | Test + Deploy Deploy |
Cucumber Tests | On this step, the integration tests are executed to check the integrity of the data flows. | Maven and Cucumber | Test + Deploy Test |
Deploy on runtime | In this step the pipeline gets the app running on the runtime server. To do so, it uses an sshagent to connect to the server. Afterwards, it runs a pre-existing script to clean the currently running containers, if there’s any. Then, it fetches the Smart Mirror artifact from artifactory and transfers the Dockerfile from Jenkins, using it to build the docker image and finally it runs the container. To finish, it pulls the emotion detection and doctor app images from the docker registry and runs them. | SSH command | Test + Deploy Deploy |
Prepare Reports | On this step, the pipeline saves the cucumber tests reports, so they can be consulted on the Jenkins page. | Cucumber Reports Jenkins plugin | Test + Deploy Test |
Requirements
Notes on requirements for the pipeline to work
- Kafka Broker, running on port
9093
- MySQL, running on port
3037
- A fully configured ELK Stack
- Camera
- Microphone
Monitoring
To upload our data to Elastic Search, we’re using a appender for logback. This appender is configured on the
logback.xml
, available on the source code. This data can then be visualized on Kibana, by consulting the index
“esp30-logs”
.
As all our logs messages are uploaded there, this data can be filtered to show all kinds of information about the running system, from status to the emotions being captured.