?? Day 4 ??: Poll SCM in the Build Triggers.
Vaibhav Jain
DevOps | Cloud | AWS | CI/CD | Red Hat Linux | Git/Github | Docker | Ansible | Terraform | Kubernetes | Networking
what is Poll SCM?
Configure Jenkins to poll changes in SCM(Git ). Note that this is going to be an expensive operation for CVS, as every polling requires Jenkins to scan the entire workspace and verify it with the server. Consider setting up a "push" trigger to avoid this overhead.
so yesterday we saw the Build periodically method. but in this method, one thing is that we did not Off the machine so our builds are run continuously the whole time. And there are like 700+ builds that run themselves as we set the time to build every minute.
Poll SCM is doing according to the need to monitor the file on the Github Repository.
Build periodically scheduled the crone job.
so our machine is running wasting the whole time we put the waste load on the server. so for this, we are considering more options with Jenkins.
As we can see below:
And many more options like Poll SCM that we see today and more things.
so the thing is Today we run the build with the Poll SCM and we set that as we update our index.html or we make some changes in the build is automatically run and changes will automatically push to the GitHub.
for the automation, we have to create a file in the git configuration for the Github automation.
we go into the hooks folder and create the file in this:
cd .git/hooks/
we also see one thing as we go into the /hooks folder our branch is automatically changed into the (GIT_DIR) Git _directory so in this folder we see how many files there are
the hooks folder is here for the local. these files are automatically executable files.
so here you want to create an executable file so it can run automatically in the backend. Here we do not need any extension.
this is your script file:
after saving the file. as we define the after-commit actions. we can see that when we do any commit. the actions are running automatically.
领英推荐
As we can see our last build is #741 and we also stopped the build periodically setting.
And our last web form is it:
we are adding an Amazon link to our web page through the git bash:
As we commit the changes our local. we see that the git also pushes the file in Github:
so as we see here in the Github the file is updated now:
so we set the time in the Poll SCM that if some changes in the GitHub repository the build execute aster execute:
Here we can see the how the mechanism work of the Poll Scm:
so as we see that our web page is updated and our job is built itself:
so the next topic is Build queue:
what is a build queue in Jenkins?
In Jenkins, a build queue is a holding area where build requests wait until there are available executors to process them. Executors are the entities within Jenkins that run jobs. When a build is triggered, it is placed in the build queue if all executors are currently busy. The queue ensures that build requests are managed in a fair and orderly manner.
Til now we worked on the single node but in Jenkins, we don't work on the single node architecture, The architecture that Jenkins creates is multiple node architectures:
so tomorrow we will see the architecture of Jenkins and we also create the multi-node cluster.
Thank you??