How to use Trigger a build remotely option in Jenkins after code commit?

751 Views Asked by At

I am totally new to Jenkins. I am facing issue in triggering a build automatically after code commit, I have tried the following steps to achieve it

1) Created a New repository locally and commits a code into that repository.

2) Selected "Use custom workspace" option in Jenkins and given the valid path in Directory filed.

2) Selected "Subversion Release" option in Jenkins and given valid Repository Url.

3) Selected "Trigger builds remotely" option in Jenkins, plz refer the screenshot attached below. Build Trigger

4) Under "Build" option I've selected "Executed windows batch command" and gave valid file name with (.bat) extension.

5) Modified "post-commit.tmpl" file to "post-commit.bat" in my local repository.

6) Changed the content present in that file (post-commit.bat) to curl http://jenkin’s username:jenkin’s password@localhost:8080/jenkins/job/Auto-POC/build?token=MyAuth

Now, whenever I commit my code Jenkins doesn't trigger the build automatically

Any help is greatly appreciated.

1

There are 1 best solutions below

0
Rohith On

If you want your job to be triggered whenever you commit code to SVN, use Poll SCM option in Build triggers. This will pole on your SVN and do mention the polling interval