How to configure git post commit hook?
Answer / Anita
To configure a Git post-commit hook in Jenkins, follow these steps:n1. Navigate to the repository on your local machine and create a new file called 'post-commit' without any extension.n2. Open the file with a text editor and paste the following command: curl -X POST --data 'token=YOUR_JENKINS_TOKEN' https://YOUR_JENKINS_URL/github-webhook/n3. Replace 'YOUR_JENKINS_TOKEN' with your Jenkins API token and 'YOUR_JENKINS_URL' with the URL of your Jenkins instance.n4. Save the file, make it executable (chmod +x post-commit), and add it to the Git repository.n5. Push the changes to the repository to trigger the hook.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the various ways in which the build can be scheduled in jenkins?
Let us say, you have a pipeline. The first job was successful, but the second failed. What should you do next?
Can you define a continuous delivery workflow?
What is the tool used for provisioning and configuration?
What is continuous integration and deployment?
What are the pre-requisites for using jenkins?
What are the types of pipelines in jenkins?
How to trigger a build remotely from jenkins?
Name a jenkins environment variable you have used in a shell script or batch file.
What is the solution if you find a broken build for your project?
what are the commands you can use to start Jenkins manually?
How do you define parameters for a build in jenkins?