简体   繁体   中英

Continuous integration using git branches

For every story we use a branch in Git. This works great locally but poses a problem when finalizing a feature as we (currently) only push master to our Test environment (IIS). Note that we are using Git next to TFS as TFS is still our main VCS.

We are using TeamCity to build all our branches. How do you test and review code on a test machine while not polluting the main branch? Create multiple IIS applications for every branch? This could be automated but seems contrived.

To clarify, we need to be able to simultaneously test different versions on our test environment.

To summarize, I've created several applications in IIS, one for every dev in the team (dev & test) and then 3 slots for test purposes alone.

In teamcity we have the build run every against every branch, but do not deploy automatically anymore. The reasoning is that we allow pulls of our builds but don't force upgrades.

When all dev work on a feature branch is complete we merge into master and then sync immediately with TFS so that our master branch is in sync. This allows us to merge each feature per changeset into the next stage.

I think you are looking for --dry-run switch:

-n, --dry-run
Do everything except actually send the updates.

git push --dry-run ...

Please note that having multiple test version of the same application can be really confusing!!

You can adopt something like the GitHub Flow :

  • One branch per feature
  • When the feature is done you deploy it to the test environment
  • If everything is OK you can merge the feature to master

In case this is not a viable solution for you, the only alternative I see is to deploy multiple IIS applications. This can be done relatively easily using a tool like WebDeploy , but you have to think about a "clean-up policy" to remove obsolete web applications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM