Commit and Push in Job
This tutorial explains how to make code changes in build job, and push committed change back to OneDev server
Make sure your account has code push permission over current project. Switch to my access token page and copy the value to clipboard
Edit project build setting to add a job secret using the value copied above
Configure checkout step of the job to retrieve source with http(s) credential, and choose job secret created above as access token
Add shell/batch step to call appropriate git commands to commit and push, for instance:
Commands used in this example step:
git config --global user.name "Your Name"
git config --global user.email "you@@example.com"
# Fetch and checkout master as OneDev by default clones
# code up to current commit
git fetch origin master:master
git checkout master
echo @build_number@ > build_number.txt
git add build_number.txt
git commit -m "Update build number"
git push origin master:masterIn case you configured the job to fire automatically upon branch update, you will need to exclude files changed during job in the job trigger to avoid infinite loop. In this case we exclude build_number.txt as shown below: