PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, September 27, 2022

[FIXED] How to take code backup in TFS 2015 during Release Management/Pipeline

 September 27, 2022     continuous-deployment, powershell, tfs, tfs-2015     No comments   

Issue

I've done Build for my code in TFS 2015. Now i'm configuring CD, my tasks would be

  1. Take Backup of existing release code
  2. Deploy build artifact to my server
  3. Rollback task if deployment fails

I'm struck with Task 1 : Take backup of exiting release code.

I would prefer using PowerShell task as suggested over here, as my my release server path differs with different an ID {mulitple paths with multiple Id's]


Solution

How to take code backup in TFS 2015 during Release Management/Pipeline

Indeed, Backing up existing release code on the server is really a tricky issue, if your release server path differs with different an ID. It seems we have to create several task to back up release code from different release server path or we have to write the scripts(PS, Batch) to back up those release code.

To resolve this question, I would like provide a workaround, you can check if it works for you. The tasks would be:

  1. Deploy build artifact to the server.
  2. Use Copy task to back up the build artifact to the local folder of the TFS server machine with condition Only when all previous tasks have succeeded.
  3. Deploy backup artifact to the server with condition Only when all previous tasks failed (Also check the option Clear Target Folder under the Advanced tab).

Some explanations for tasks 2 and task 3:

Task2: This steps is use to back up the release code of the last successful deployment, and save it to the local folder on the server.

Task3: This steps is used to deploy the back up the release code to overwrite the release code that failed to deploy before, if the previous deployment task failed.

Hope this helps.



Answered By - Leo Liu
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing