DevOps ~ CI with Jenkins - rohit120582sharma/Documentation GitHub Wiki

Jenkins integration with Git & GitHub

Install the Git

  • In Mac/Window machine, download and install the git from this link.

  • In Linux machine, use below command in terminal:

    $ sudo apt-get install git
  • Install the plugin, so open "Manage Jenkins ––> Manage Plugins ––> Github Integration".


Configure Jenkins with Git

  • Open "Manage Jenkins ––> Global Tools Configuration"

  • Add JDK & Git by providing a name and path

    # JDK
    name: LocalJava8
    path: /Library/Java/JavaVirtualMachines/jdk1.8.0_241.jdk/Contents/Home
    
    # Git
    name: LocalGit
    path: /usr/local/bin/git


Infrastructure as Code

Jenkins allows user to manage the Jenkins jobs via UI parameters.

This may introduce few problems:

  • No proper audit trail
  • No history of changes
  • Developers dependency on DepOps or System admin
  • Difficult to back and restore

Infrastructure as Code (IaC) is the ability to programatically manage and provision an entire technology stack through code, rather than using manual and complex processes.

Jenkins DSL is a programatic way to implement the Jenkins jobs.

Jenkins Job DSL plugin is used to define jobs in programatic form.

DSL stands for domain specific language.

User can create multiple jobs with Jenkins DSL plugin and it comes with lots of benefits like Version Control, Audit Histroy, Peer Review, Rollback and Backup.

⚠️ **GitHub.com Fallback** ⚠️