How to report build progress to TFS vNext from within a powershell script?
up vote
0
down vote
favorite
My vNext build contains very few steps - I just setup a few settings and call the main Powershell build script, which internally invokes msbuild, but it also does other things too.
I know that vNext comes with a distributed msbuild logger that allows msbuild to report events up to vNext to be displayed in the step Timeline.
Can this be done for arbitrary logic, not just msbuild?
EDIT 1
My philosophy to writing vNext (or Octopus) project is to minimize the number of steps. This is because these steps are code, but neither vNext nor Octopus provide the environment I expect to get when writing code, specifically:
- Version Control
- Technically vNext has it, but for me VCS implies easy diffing with the other versions. vNext diff is full of irrelevant crap. Still light years better than Octopus, which has none.
- Code Review
- Associated Work Items (why did X made change Y?)
- Debugging
For me these are essential and that is why I tend to have one master build script. I do delegate stuff to vNext (Octopus) - like publishing artifacts and tests or getting sources. But the code that runs on the particular machine locally is my Powershell script.
powershell tfs msbuild azure-devops vnext
add a comment |
up vote
0
down vote
favorite
My vNext build contains very few steps - I just setup a few settings and call the main Powershell build script, which internally invokes msbuild, but it also does other things too.
I know that vNext comes with a distributed msbuild logger that allows msbuild to report events up to vNext to be displayed in the step Timeline.
Can this be done for arbitrary logic, not just msbuild?
EDIT 1
My philosophy to writing vNext (or Octopus) project is to minimize the number of steps. This is because these steps are code, but neither vNext nor Octopus provide the environment I expect to get when writing code, specifically:
- Version Control
- Technically vNext has it, but for me VCS implies easy diffing with the other versions. vNext diff is full of irrelevant crap. Still light years better than Octopus, which has none.
- Code Review
- Associated Work Items (why did X made change Y?)
- Debugging
For me these are essential and that is why I tend to have one master build script. I do delegate stuff to vNext (Octopus) - like publishing artifacts and tests or getting sources. But the code that runs on the particular machine locally is my Powershell script.
powershell tfs msbuild azure-devops vnext
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
My vNext build contains very few steps - I just setup a few settings and call the main Powershell build script, which internally invokes msbuild, but it also does other things too.
I know that vNext comes with a distributed msbuild logger that allows msbuild to report events up to vNext to be displayed in the step Timeline.
Can this be done for arbitrary logic, not just msbuild?
EDIT 1
My philosophy to writing vNext (or Octopus) project is to minimize the number of steps. This is because these steps are code, but neither vNext nor Octopus provide the environment I expect to get when writing code, specifically:
- Version Control
- Technically vNext has it, but for me VCS implies easy diffing with the other versions. vNext diff is full of irrelevant crap. Still light years better than Octopus, which has none.
- Code Review
- Associated Work Items (why did X made change Y?)
- Debugging
For me these are essential and that is why I tend to have one master build script. I do delegate stuff to vNext (Octopus) - like publishing artifacts and tests or getting sources. But the code that runs on the particular machine locally is my Powershell script.
powershell tfs msbuild azure-devops vnext
My vNext build contains very few steps - I just setup a few settings and call the main Powershell build script, which internally invokes msbuild, but it also does other things too.
I know that vNext comes with a distributed msbuild logger that allows msbuild to report events up to vNext to be displayed in the step Timeline.
Can this be done for arbitrary logic, not just msbuild?
EDIT 1
My philosophy to writing vNext (or Octopus) project is to minimize the number of steps. This is because these steps are code, but neither vNext nor Octopus provide the environment I expect to get when writing code, specifically:
- Version Control
- Technically vNext has it, but for me VCS implies easy diffing with the other versions. vNext diff is full of irrelevant crap. Still light years better than Octopus, which has none.
- Code Review
- Associated Work Items (why did X made change Y?)
- Debugging
For me these are essential and that is why I tend to have one master build script. I do delegate stuff to vNext (Octopus) - like publishing artifacts and tests or getting sources. But the code that runs on the particular machine locally is my Powershell script.
powershell tfs msbuild azure-devops vnext
powershell tfs msbuild azure-devops vnext
edited Nov 11 at 19:06
asked Nov 11 at 0:40
mark
19.1k55184370
19.1k55184370
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06
add a comment |
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
I agree with the comments suggesting that you split the build pipeline process into multiple steps/tasks to better see and log overall status. That said, there is a way to report progress back to the build timeline. You can use the ##vso[task.setprogress]
command documented on the Azure Pipeline Tasks Logging Commands page. The following will print the progress percentage in the log/console as well as display the percentage next to the step name in the timeline:
$myArray = @(1..10)
foreach ($item in $myArray) {
$simplePercentage = (($myArray.IndexOf($item)/$myArray.Length)*100)
Write-Output ("Current Percentage: $simplePercentage")
Write-Output ('##vso[task.setprogress value={0};]{1}' -f $simplePercentage, 'My Sample Task')
Start-Sleep -Seconds 3
}
You can split your Powershell script/functions into whatever overall percentage and then use that logging command to report the sections' progress.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
I agree with the comments suggesting that you split the build pipeline process into multiple steps/tasks to better see and log overall status. That said, there is a way to report progress back to the build timeline. You can use the ##vso[task.setprogress]
command documented on the Azure Pipeline Tasks Logging Commands page. The following will print the progress percentage in the log/console as well as display the percentage next to the step name in the timeline:
$myArray = @(1..10)
foreach ($item in $myArray) {
$simplePercentage = (($myArray.IndexOf($item)/$myArray.Length)*100)
Write-Output ("Current Percentage: $simplePercentage")
Write-Output ('##vso[task.setprogress value={0};]{1}' -f $simplePercentage, 'My Sample Task')
Start-Sleep -Seconds 3
}
You can split your Powershell script/functions into whatever overall percentage and then use that logging command to report the sections' progress.
add a comment |
up vote
1
down vote
accepted
I agree with the comments suggesting that you split the build pipeline process into multiple steps/tasks to better see and log overall status. That said, there is a way to report progress back to the build timeline. You can use the ##vso[task.setprogress]
command documented on the Azure Pipeline Tasks Logging Commands page. The following will print the progress percentage in the log/console as well as display the percentage next to the step name in the timeline:
$myArray = @(1..10)
foreach ($item in $myArray) {
$simplePercentage = (($myArray.IndexOf($item)/$myArray.Length)*100)
Write-Output ("Current Percentage: $simplePercentage")
Write-Output ('##vso[task.setprogress value={0};]{1}' -f $simplePercentage, 'My Sample Task')
Start-Sleep -Seconds 3
}
You can split your Powershell script/functions into whatever overall percentage and then use that logging command to report the sections' progress.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
I agree with the comments suggesting that you split the build pipeline process into multiple steps/tasks to better see and log overall status. That said, there is a way to report progress back to the build timeline. You can use the ##vso[task.setprogress]
command documented on the Azure Pipeline Tasks Logging Commands page. The following will print the progress percentage in the log/console as well as display the percentage next to the step name in the timeline:
$myArray = @(1..10)
foreach ($item in $myArray) {
$simplePercentage = (($myArray.IndexOf($item)/$myArray.Length)*100)
Write-Output ("Current Percentage: $simplePercentage")
Write-Output ('##vso[task.setprogress value={0};]{1}' -f $simplePercentage, 'My Sample Task')
Start-Sleep -Seconds 3
}
You can split your Powershell script/functions into whatever overall percentage and then use that logging command to report the sections' progress.
I agree with the comments suggesting that you split the build pipeline process into multiple steps/tasks to better see and log overall status. That said, there is a way to report progress back to the build timeline. You can use the ##vso[task.setprogress]
command documented on the Azure Pipeline Tasks Logging Commands page. The following will print the progress percentage in the log/console as well as display the percentage next to the step name in the timeline:
$myArray = @(1..10)
foreach ($item in $myArray) {
$simplePercentage = (($myArray.IndexOf($item)/$myArray.Length)*100)
Write-Output ("Current Percentage: $simplePercentage")
Write-Output ('##vso[task.setprogress value={0};]{1}' -f $simplePercentage, 'My Sample Task')
Start-Sleep -Seconds 3
}
You can split your Powershell script/functions into whatever overall percentage and then use that logging command to report the sections' progress.
answered Nov 11 at 8:42
Michael
1,1191716
1,1191716
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53244812%2fhow-to-report-build-progress-to-tfs-vnext-from-within-a-powershell-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
you want build progress (not status)? how would powershell know progress of something its invoking?
– 4c74356b41
Nov 11 at 6:54
Why not to seprate the steps to few powershell tasks + mdbuild task? one ps task for very few things is not the best way to use vNext build.
– Shayki Abramczyk
Nov 11 at 8:23
I provide explanation why I do not have many steps.
– mark
Nov 11 at 19:06