Skip to content

A Project on Jenkins that pull the deploys the code to the production environment and deploys the feature branch to the testing environment, which will be automatically sent to production as soon as the Quality Assurance team accepts it.

Notifications You must be signed in to change notification settings

devmohit-live/jenkinsproj1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

dockerbg

Objective :

Setup up an infrastructure such as there are three teams/environemnts :

  1. Production
  2. Testing
  3. Quality Assurance

Production Team will deploy the code first, now there is some work going on in the developement team which is to be deployed on testing environment which will be sent to the production only when the QA team approves it.

Requirements :

  1. Docker
    • Image: httpd
  2. Jenkins
    • Github Plugin
  3. System with 2gb ram (Recommended)
  4. Git and Hooks
  5. Github and Github Webhooks
  6. ngrok

My Approach

  1. Made 3 Jobs for produnction, testing and Quality Assurance

  2. Make Environments for production and testing. I am using docker here, I have created a volume(persistant storage) for production and testing and mounted them to their respective containers

Process :

Operations Side:

  1. My job 1 and job2 will get their code from the github (from their respective branches => master:production, dev:testing)
  2. Both the containers have diferent web addresses so the quality team can monitor both
  3. Quality team continously checks for changes in testing environemnt, and decides wether to approves it or not
  4. On approval QA team manually builds the job3
  5. Since job three is the upstream job of job2 and job1 , so on succesfull approval foloowong things will happen:
    1. Dev and Master branch will be merged
    2. Code will be pushed to the github
    3. job 1 and job2 will be build
  • ngrok will be running in the system to provide public accessable addres so that github webhook will work and production site can be accessible to the public

Developer site :

  1. Created a hook for post-commit and post-merge so the developer need not to be manually push the code each time he commits

    edit

    merges

  2. Added The webhooks to the Jenkins Github API :=> ip/github-webhook/

Producntion

Screenshots :

1. Initially:

  1. Production:

Producntion

  1. Testing :

Testing

2. Changed made but not approved:

  1. Produnction:

Producntion

  1. Testing :

Testing

  1. QA Rejected

Changed and approved:

  1. Testing :

Testing

  1. QA Approved:

QA0

QA1

QA2

  1. Production:

    Producntion

Steps and Configurations Screenshots :

1. Production:

  • Created a job for cloning the Github repo's master branch which is to be deployed on docker. Github Githook trigger is checked so that whenever the developer pushes the code, github webhook will be activated and it will contact jenkins, then jenkins will pull the updated code, and move it to the created volume.

01

  • Provided the command to check wether the docker conatiner is already running, if not create it mount the volume and expose it's port 80 to base os port 8082.

02

2. Testing:

  • Created a job for cloning the Github repo's master branch which is to be deployed on docker. Github Githook trigger is checked so that whenever the developer pushes the code, github webhook will be activated and it will contact jenkins, then jenkins will pull the updated code, and move it to the created volume.

01

  • Provided the command to check wether the docker conatiner is already running, if not create it mount the volume and expose it's port 80 to base os port 8083 QA team will check the testing environment at this port address.

02

2. QA Team :

  • Provided the github repo link along with credentials as on approval there should be a merge between the master and dev branch, and also the code should be pushed to github.

01

  • Details is provided to the additional behaviour so that merging could be done.

02

  • Post Build Action deatils provided, so that push after the merge can be done

02

  • After the push is being done. This job will call the job1 and job2 so that the code can be updated. (This part can be omitted as webhook will do it's job, but to be on safe side, I have put these projects as downstream projects)

02

About

A Project on Jenkins that pull the deploys the code to the production environment and deploys the feature branch to the testing environment, which will be automatically sent to production as soon as the Quality Assurance team accepts it.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages