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,540 points
127 views

1 answer to this question.

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,280 points

Related Questions In DevOps & Agile

0 votes
2 answers

Where can I get a hands on master class for certified Solutions Architect and DevOps?

Hey, @Boldbald, As you are also on the ...READ MORE

answered Sep 11 in DevOps & Agile by Gitika
• 36,530 points
49 views
+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,850 points
7,579 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
1,313 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
669 views
+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
• 18,410 points
154 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
• 51,950 points
8,654 views