Integrating GitHub, Jenkins and Docker

Integrating GitHub, Jenkins and Docker

This article discusses how the three great technologies - GitHub, Jenkins and Docker, can be clubbed together to automate the task of downloading, deploying and testing the code. The code will be downloaded from GitHub. Then, a docker container will be launched having the respective interpreter of code and testing will be initiated. All these tasks will be automated via Jenkins tool.

To begin with, some docker images are created using Docker file method.

1. Docker image containing Jenkins

No alt text provided for this image

2. Docker image containing Python interpreter

No alt text provided for this image

Now, the docker image having Jenkins is launched. (In the image below, the container launched has the name 'jenkins')

No alt text provided for this image
No alt text provided for this image

Now, the role of Jenkins' jobs come into play.

Job 1 : Pulling code from GitHub

This job pulls the code from GitHub whenever a developer pushes a code to the GitHub repository.

No alt text provided for this image

Job 2 : Identifying the code for launching image having respective language interpreter

This job will identify the language of code and launch the docker image having respective language interpreter in it.

No alt text provided for this image

A Python code will help in identifying the language of code. (DockerFile.py)

No alt text provided for this image

Job 3 & 4 : Checking if code is working or not

This job will test the code and if the code fails to execute, an email will be sent to the developer regarding the failure via Jenkins' plugin with the logs attached.

No alt text provided for this image
No alt text provided for this image

Hence, the trio has been integrated to solve yet another use case in the industry thus, making the process of code deployment and testing more efficient.

To view or add a comment, sign in

Others also viewed

Explore content categories