Can I run a program on release failure in TFS?

0 votes
Is there any way to run a console app on build/release failure in TFS.
Apr 26, 2018 in DevOps & Agile by Atul
• 5,490 points
26 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You can try and do the following steps:

  1. Check in to the console app by simply printing a random line like('it's running'). You can check in and make it copy the build/release agent

    Console.WriteLine("Console app has run!");
  2. Add these powershell task inline in the build definition to simulate failure

    Write-Host "HI"

    Write-Error ("ERR")

    exit 1

enter image description here

  1. add the run command line task giving path to console app. Now, the control option is already set to run this task only when an earlier task has failed to execute.

enter image description here

If the powershell task and the build fails, by default the next task will not run, but since the console application task is executed only when the previous task fails, your task will run

enter image description here

if your powershell task runs to end the console application won't execute.

enter image description here

answered Apr 26, 2018 by ajs3033
• 7,080 points

Related Questions In DevOps & Agile

+3 votes
2 answers
+1 vote
8 answers

How can I implement process.env in Angular 5 environment?

Users do not have access to process.env ...READ MORE

answered Apr 3, 2018 in DevOps & Agile by DareDev
• 6,670 points
3,258 views
+1 vote
2 answers

How do I run Apache server from Docker without mapping to a location?

If you're seeing a 500 error, that's ...READ MORE

answered Oct 18, 2018 in DevOps & Agile by lina
• 8,100 points
54 views
+13 votes
5 answers

How do I run a cron job inside a docker container

If you can SSH into your server ...READ MORE

answered Jul 27, 2018 in DevOps & Agile by Kalgi
• 36,420 points
1,395 views
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
846 views
+13 votes
2 answers
+1 vote
3 answers

How can I connect an app with an aws ec2 instance?

This is how you deploy a web ...READ MORE

answered Oct 18, 2018 in DevOps & Agile by Hannah
• 14,080 points
32 views
0 votes
2 answers

Running a cron job in a docker conratiner

Let’s create a new file called "crontab" ...READ MORE

answered Aug 7, 2018 in DevOps & Agile by Kalgi
• 36,420 points
2,321 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.