简体   繁体   中英

Single Team Foundation command exits build step after execution in Jenkins

When executing Team Foundation commands in a free-style Jenkins job on a Windows Slave (within a 'Execute Windows Batch command' section), the successful execution of a command will cause that build step of batch commands to exit regardless of whether there are other commands remaining after the tf.cmd call.

For example, to create a new workspace and then map that workspace, I need 2 individual instances of 'Execute Windows Batch command' build steps. Placing both these commands in the same build step will result in only the first being executed.

Does anyone know why this might be happening and how to resolve it (other than the current workaround of many build steps).

Thanks.

Note: The TF plugin does not fit my needs for this particular Jenkins job because the plugin does not allow gets from labels.

Since there isn't another answer for a while, I recently found a different workaround that resolves this issue a bit nicer.

When calling the tf.cmd, use call before the command. This allows multiple tf commands to be executed in the same Jenkins window.

Example:

call tf.cmd workspaces /format:brief /server:http://servername

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM