Code Monkey home page Code Monkey logo

jenkins_project's Introduction

jenkins_project

GOAL :

To create a system in which there are two enviorment testing server and prodution server. When the developer push any changes test/dev branch of git then it will automatically deployed on testing server. The testing/Quality assurance team will confirm these changes and will trigger the merging of dev/test branch with master branch and will be deployed to actual production server.

Working proof :

Here

Requirements :

  1. Docker
    • image: httpd
  2. Jenkins
    • plugin: github
  3. Git/ Github account
  4. ngrok

Pre-requisite:

  • Give jenkins user superuser power.
  • Add a webhook in your github repo.
  • Run ngrok so that github webhooks can work.

Steps :

There are three jobs test-deploy that will deploy test-code to testing server, master-deploy that will deploy actual production code to production server and merge-job that will merge the dev/test branch to master and push changes to github.

  • Devloper will push some new changes (features/hotfixes) for website that needs to be tested to the dev/test branch. This push operation will automatically trigger test-deploy job, that will create a docker container and deploy the test code.

  • Quality Assurance/ Testing team will continously test changes made in website on testing server.

  • After Quality Assurance team approves new code, then they will manually trigger merge-job either using the script or jenkins url.

  • Since merge-job is upstream of master-deploy job it will do following things

    • merge the dev branch to master branch
    • push the changes to github
    • master-deploy job will be triggered and new code will be deployed to production server.

Configuration

1. Testing

  • Created a job that will clone github's dev/test branch and will deploy that code to new docker container. This job is triggered by using github webhooks, Whenever developer pushes changes to dev/test branch it will trigger this job. test-deploy test-deploy-2

2. Quality Assurance

  • Created a job that will clone the repo's dev and master branch and will merge the dev branch with master branch, if there is any merge-conflict then it will aborted else changes will be pushed back to github. This job will then trigger the master-deploy job. merge-job merge-job merge-job merge-job

3. Production

  • Created a job that will clone repo's master branch and will deploy it to the actual production server that is running on docker container. This job will run only when merge-job is successful. prod prod prod

Further Possibilities

  1. Add a feature -- that will send notification to developer when there is a merge conflict.
  2. Add a feature -- send email/notification when developer pushes changes to dev , testing team will be automatically notified.

jenkins_project's People

Contributors

harsh-gautam avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.