TFS merge during build and release

barii

We are using visualstudio.com TFS to store the source code. We have DEV, STG and PROD branches. now I want to automate build and release to IIS server. But it looks like to me that TFS compiles the code from the branch where I commit to, and that's the only build, after that I can install the same binary on all the servers. But it doesn't seem to be ok, because what if we find a bug on the live code, so we need to fix it, but we already have new code in DEV, and we don't want to revert, and install the old code with the fix on the dev server?

What I think we should do is to merge the code from DEV to STG, from STG to PROD, but I couldn't find any module for that. And it looks strange, I would be surprised if I am the only person whats to do this, especially because it is doable with Jenkins.

thanks

Daniel Mann

I typically discourage automating merging of code between branches; merging should be a deliberate action. When someone expresses that desire, it's usually a sign of a problem with the branching model and deployment model they're using.

Code promotion branching (where you have one branch that corresponds to each environment, as in the scenario you described) is a bad practice because it encourages you to build different sets of binaries for each environment. You build something for a lower environment, test it, validate it, then totally disregard that testing and rebuild from source. That should terrify you, especially for production branches -- you have no idea if what you just built is going to work properly.

Current thinking is to minimize the number of branches you have, and instead isolate in-progress work behind feature toggles so that features that aren't ready for production can simply be disabled, but still allow deployments to take place. With sufficiently mature feature toggling practices and testing practices in place, you can actually eliminate branching entirely and work out of a single branch, promoting binaries to production whenever your automated and manual QA process deems the version they're testing is good.

Assuming you're using TFVC, if you want to maintain a code promotion branching strategy, then you'll need to maintain multiple builds and releases, one for each branch/environment. Typically, in this kind of scenario, I'd eliminate the stage branch entirely. Anything that goes to the Dev branch is built and deployed to Dev. Anything that goes into the Prod branch is built and follows a deployment pipeline from staging->production. Hotfixes can go directly into the prod branch and be merged backwards. There are tons of strategies for branching; you'll need to read up on the subject and design a branching and release strategy that works best for your team.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

TFS 2017 Change Release summary description during build

From Dev

TFS 2017 - Build and Release

From Dev

Integrate a TFS Build with Release Management

From Dev

TFS 2015 Release management access build variables

From Dev

TFS release management build agent is not available

From Dev

Build and Release Menu Missing in TFS2015

From Dev

Release Management in TFS without build automation

From Dev

How to determine the build definition that triggered a release in TFS?

From Dev

TFS 2018 - Build and Release - Library - Variable groups

From Dev

Errors occurred during the release build in Eclipse IDE?

From Dev

Running Xcode unit tests during release build

From Dev

Call custom Umbraco targets during TFS build

From Dev

Add label to TFS SourceControl during vNext build

From Dev

Call custom Umbraco targets during TFS build

From Dev

Hot-fix during the ongoing release - merge or cherry-pick?

From Dev

Merge build definition changes back into build template in TFS 2013

From Dev

What ports are used for VSTS/TFS Build/Release Agent?

From Dev

Trigger Visual Studio Online Release from TFS Build

From Dev

Is possible to pass a variable from a Build to a Release in TFS 2017?

From Dev

TFS Build release IIS Deployment Virtual path should begin with a / Error

From Dev

"Access Denied" error during TFS XAML build process

From Dev

TFS2015 - Determine impacted tests during vNext build

From Dev

"Access Denied" error during TFS XAML build process

From Dev

SonarQube plug-in not scanning C# files during TFS Build

From Java

build failing during merge resources with Android Gradle plugin 3.3.0

From Dev

How to get TFS2012 to include a changeset in the build that was checked in during the build process?

From Dev

The account running the TFS build service (NT AUTHORITY\NETWORK SERVICE) needs to be added as a system user in the Release Management Server

From Dev

TFS 2015 Build / Release - View History Test Results for Automated Test Cases

From Dev

Git operation during TFS build: "fatal: could not read Password" (wincred used)

Related Related

  1. 1

    TFS 2017 Change Release summary description during build

  2. 2

    TFS 2017 - Build and Release

  3. 3

    Integrate a TFS Build with Release Management

  4. 4

    TFS 2015 Release management access build variables

  5. 5

    TFS release management build agent is not available

  6. 6

    Build and Release Menu Missing in TFS2015

  7. 7

    Release Management in TFS without build automation

  8. 8

    How to determine the build definition that triggered a release in TFS?

  9. 9

    TFS 2018 - Build and Release - Library - Variable groups

  10. 10

    Errors occurred during the release build in Eclipse IDE?

  11. 11

    Running Xcode unit tests during release build

  12. 12

    Call custom Umbraco targets during TFS build

  13. 13

    Add label to TFS SourceControl during vNext build

  14. 14

    Call custom Umbraco targets during TFS build

  15. 15

    Hot-fix during the ongoing release - merge or cherry-pick?

  16. 16

    Merge build definition changes back into build template in TFS 2013

  17. 17

    What ports are used for VSTS/TFS Build/Release Agent?

  18. 18

    Trigger Visual Studio Online Release from TFS Build

  19. 19

    Is possible to pass a variable from a Build to a Release in TFS 2017?

  20. 20

    TFS Build release IIS Deployment Virtual path should begin with a / Error

  21. 21

    "Access Denied" error during TFS XAML build process

  22. 22

    TFS2015 - Determine impacted tests during vNext build

  23. 23

    "Access Denied" error during TFS XAML build process

  24. 24

    SonarQube plug-in not scanning C# files during TFS Build

  25. 25

    build failing during merge resources with Android Gradle plugin 3.3.0

  26. 26

    How to get TFS2012 to include a changeset in the build that was checked in during the build process?

  27. 27

    The account running the TFS build service (NT AUTHORITY\NETWORK SERVICE) needs to be added as a system user in the Release Management Server

  28. 28

    TFS 2015 Build / Release - View History Test Results for Automated Test Cases

  29. 29

    Git operation during TFS build: "fatal: could not read Password" (wincred used)

HotTag

Archive