Automating Developer and Client Connection
Workflow of Task

Automating Developer and Client Connection

One great automation using GitHub, Docker, and Jenkins which is a replica of real industry production and developer system. In this project, I tried to simulate testing and production environments as every product based company have.

How a developer build code and it goes under Quality Check and then after successful quality checks it proceeds further for the production or launching.

Jenkins And Docker are installed in RHEL OS
Jenkins is added in sudoers file.

User has a Github Profile and Git Bash is Installed 

STEPS:

Step 1: Create a folder on your preferred place.
 -Task

    - index.html
    
 
    - home.html

No alt text provided for this image
Step 2: Create branch and automate push command
No alt text provided for this image
Step 3: Set up Jenkins

Job1:

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

Execute shell:

if sudo docker ps | grep production_server
then
echo "Production Server Already Running"
else
sudo docker run -d -t -i -p 8081:80 -v /prodDir:/usr/local/apache2/htdocs/ --name production_server httpd
fi

sudo cp -r -v -f * /prodDir/ 
No alt text provided for this image

Click apply and then save

Job2

No alt text provided for this image

Build triggers : use polling in every minute (although we can use hooks which is better option but for now am going with polling)

No alt text provided for this image

Execute Shell:

if sudo docker ps | grep test_server
then
echo "Test Server Already Running"
else
sudo docker run -d -t -i -p 8082:80 -v /testDir:/usr/local/apache2/htdocs/ --name test_server httpd
fi

sudo cp -r -v -f * /testDir/
No alt text provided for this image

Click apply and then save

Job3:

No alt text provided for this image

Build triggers : No need to add this trigger , as testing team will run this job but assuming that all tests are good so we trigger this job just after Job2

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

Click apply and then save

Conclusion

Now Everything is configured. As soon as the developer branch is commit by developer locally, it gets push on GitHub, Then our Job2 Job gets code from branch developer and deploy to test server. Finally our Job3 merges the branches by using credentials provided and production deployed.

Email: [email protected]






要查看或添加评论,请登录

Shivam Gupta的更多文章

社区洞察

其他会员也浏览了