4

I've got the following setup:

  • I use git (Stash/BitBucket) as my versioning tool.
  • My build- & deployment proccess is automated via TeamCity8.0.5 (TC)
  • Feature & Bugfix branches are automatically deployed to an IIS Web Site.

When I merge a feature branch and it gets deleted from git, it gets automatically hidden from display in TeamCity, but the deployment branch is still on the IIS.
Is there any way to remove the deployment of inactive branches from the IIS disk/directory?

Vogel612
  • 5,620
  • 5
  • 48
  • 73
phhbr
  • 2,699
  • 1
  • 14
  • 25

1 Answers1

0

If the IIS server has a git repository that is acting as a remote and thus has branches that are remotes branches to your local machine, you can remove them like this

git push --delete iis_remote old_branch

Where iis_remote is the name of the IIS git remote repository and old_branch is the branch on the remote that should be removed.

If you are looking for a script to remove all branches older than a specified time, I have made such a script here. It is written in PowerShell so it should be possible to run it on the IIS directly if necessary.

Klas Mellbourn
  • 42,571
  • 24
  • 140
  • 158