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 ffdfd
• 5,550 points
809 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,300 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, 2020 in DevOps & Agile by Gitika
• 65,770 points

edited Sep 25, 2020 by Sirajul 731 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,890 points
13,122 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
3,925 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,034 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,520 points
2,314 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
• 52,350 points
12,542 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP