Jenkins and Github Integration using PollSCM, Job Chaining and Remote Triggers, git hooks.

Integrating Jenkins with local git hooks and deploying the source code on docker containers using PollSCM triggers.

Three jobs are needed for simulating this project.

  1. Job 1

For deploying testing environment on the top of docker using git hooks(post-commit) when any commits are done from the featured branch( other than master(main branch)) and the job is scheduled using PollSCM.

git hooks => post-commit script vi .git/hooks/post-commit

#!/bin/bash echo “First and then Post Commit Tasks are started”
git fetch
git push
echo git push is done to the current Remote Branch”
#echo “remote Build Trigger using jenkins URL”
#curl — user “username:password” <
http:///job/job3/build?token=TOKEN>

Job1

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

2. Job 2

For deploying Production environment only when there is some change in master branch and scheduled using PollSCM.

Job2

— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —

3. Job 3

For merging the featured branch to the master(main) branch and triggered remotely using http:///job/job3/build?token=TOKEN with credentials of Jenkins users only and also scheduled using PollSCM.

Job3

This how we can use Jenkins Tool in a great way to automate our tasks.

P.S.- Docker image used in this environment is Apache HTTPD Docker image with tag httpd:latest. It can be pulled from hub.docker.com.
#docker pull httpd:latest

Github repo url:-
https://github.com/A4ANK/jenkins_github_integration_1.0

--

--

--

I'm a CS graduate and my primary area of work is under Linux, CloudComputing, DevOps culture, and various open-source tools and technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Using Query Tile Pro to boost your Azure DevOps Dashboard

How to Configure the Payroll Module of Odoo V15

3–5–7 Framework

How to choose the needed technology stack for your project?

2 movies that inspired me to become a software developer

Deploy Datadog Agents With Puppet Bolt

5 Networking Tips I’ve Learned About For New Tech Grads

A Tour of the Adobe Director File Format

A Macromedia Director 5 Movie, displayed in a hex editor.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ANKUR DHAKAR

ANKUR DHAKAR

I'm a CS graduate and my primary area of work is under Linux, CloudComputing, DevOps culture, and various open-source tools and technologies

More from Medium

Avoiding CI/CD dependency conflicts by using Containers

DevOps Architecture: Overview and Benefits

Install and Configure Jenkins on GCE

Continuous Deployment and Workflow Automation using Github Actions