I have a Jenkins pipeline where after every build I change a file(increase build version in a property file) and checkin back to the git repository. After a build, I commit some differnt code change to the git repo and run the build. One of the following two things happen

  1. Jenkins does not pull the latest code change from git to master machine or slave machine.
  2. The build increment checkin stage fails when we checkin from Jenkins slave.

The only solution is to wipe up the repository and build it again . Our project is a very big one and doing this every time causes a lot of time-wasting.

What configuration am i missing?

1 Answer 1

  1. You can use a plugin called "Workspace Cleanup Plugin" which wipes out the workspace post build. This can be a part of the pipeline and would not require manual cleanup every time when a build should be triggered.

  2. For the second issue, I would recommend you to check if you're able to checkin to the same repository with git credentials configured in jenkins settings through the command line in the slave.

  • Hi Thanks for the response, The main issue is i cannot cleanup the repository because the project is a very big one and checking out takes alomost a hour and we dont want to clean up but pull the commits correctly. Aug 12, 2020 at 3:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.