Skip to content

In this setup, whenever a change is made to the files in this repository and pushed to Github, a webhook will trigger and automatically push the updated files to the Jenkins server. This allows for automatic synchronization between the repository and the Jenkins server, streamlining the development workflow.

Notifications You must be signed in to change notification settings

Krishnamohan-Yerrabilli/jenkins-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerfile - Configure Webhook - Trigger Jenkins Job - git

Kubernetes final image (10)

Create a Dockerfile

And push the Dockerfile to a separate Repository

Why we need separate repo?

Because it makes it easy to Jenkins to fetch the file(more on this later)

1-Dockerfile

Now login into your Jenkins account

2-jenkins-login

Creating a pipeline, click on the new item

3-creating-pipeline-new-item

Select the pipeline

4-select-pipeline

Enter youre repo name (separate repo we created for jenkins-pipeline)

jp

We're writing a script using groovy

6-groovy-script-gitcheckout

Build is successfully

7-build-is-sucessfull-logs

What we have done until now is a manual process, let's automate this stuff. select configure gitSCM

8-selectconfigure-gitscm

Configure web hook

9-configure-webhook

To provide the API token(one type of secret), go to Jenkins

10-apitoken-for-webhook-api-to-log-through Copy the API token and paste this into the GitHub webhook. secret field

Save the stuff

11-secret-in-hooks

Reload (You will get a successful checkmark) to sync

12-refreshthe-sping

Now let's make a change in Dockerfile and push it to the separate repo we created,

This is the link we paste in Jenkins script

12-port22ssh-port-added

woohoo we successfully triggered the Jenkins, by committing a new change in the Dockerfile via GitHub

13-succesfully-trigered

happy learning!!

About

In this setup, whenever a change is made to the files in this repository and pushed to Github, a webhook will trigger and automatically push the updated files to the Jenkins server. This allows for automatic synchronization between the repository and the Jenkins server, streamlining the development workflow.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published