Search code examples
gittfshadoop-yarn

Automatically add, commit and push in TSF task


I've an upgrade script in a git project which causes the yarn.lock file to be updated as a result.

Now, this script is called in TFS via a build task. What I want is that after calling the script (it'd be a yarn task) I can configure the task to do an "add .", "commit -m "upgrade" and "push origin master" as a succession of steps.

Is this possible? I didn´t see any Git tasks when adding new steps, but I guess I could just use a cmd task to do it.

Thanks!


Solution

  • Yes, you could use Command line task to run git command. Or you could also put your git command in a atch file and you use Batch Script step. You could even use PowerShell step to run git command.

    For more detail steps, please refer to this link: https://www.visualstudio.com/en-us/docs/build/scripts/git-commands

    Another similar case: Executing git commands inside a build job in Visual Studio Team Services (was VSO)