Is my setup right?

In my company we used to deploy our application using git. We produce a fairly big software in ASP.NET with many projects among which a website frontend and a windows service backend. I actually went through the trouble of converting our frontend oldstyle "website" to a web application so that it can now be deployed this way (it wasn't fun...).
Our need is to deploy the web application to a machine, in a specific subfolder of a path which corrisponds to the name of the client (e.g. \\machine1\sites\clientA) and the window service to another machine in a similar fashion. In order to chose the client I've configured a parameter with an hardcoded list of them. To make things easier we have 2 frontend machines and I had to create another parameter to specify where it should be deployed (the parameters are 1 and 2 and are appended to "webadmin" to get the correct paths \\webadmin1 and \\webadmin2).
I've hooked this project up to our git server, looking for all the branches. This makes the build page a bit messy since it shows too much but we make extensive use of branches and any may need to be deployed at any time.

The build steps are something like this:

  1. make an HTTP call to a specific address where a program takes care of stopping the service. I do this with curl that I stored in C:\
  2. Nuget restore
  3. VS Build the solution
  4. robocopy to the front and backend. I choose robocopy because we have specific custom needs (e.g. the frontend contains an image folder that may change on a client basis and needs to be ignored since i "mirror" the two folders because it may be that we unreference an assembly and I want that to be deleted, this is not possible via TeamCity artifacts to my understanding)
  5. Same as 1. but to enable the service
  6. Write a txt in both the target machines with info on the last commit (user, date, commit, etc). This is because it may take a lot of searching to find the last build execution with a certain parameter (client name) if we want to know what is commited where. I've recently set up the labelling feature to put the client name as a label in the commit so I may remove this in the future.

For now we have switched just few clients to this method and it works great. I'm just not too sure that I'm using it correctly, more precisely I think there may be a way to set up a pair of "client name => frontend path" so that we don't have to remember on which machine they are running on. Maybe this is not clear enough: I'd like to select in the build run prompt for value from a list of clients that have configured a frontend path, this way I can use the plain client name to pass it to the program to stop the task, but also another "sub-variable" to point to the correct frontend. In JSON it would look something like:
Clients = {
     ClientA : {
          Client : "ClientA",
          Frontend: "machine1"

On top of that I would also like to deploy certain assemblies to other, customer facing, websites. The path and number of these websites is arbitrary and I wouldn't want to hardcode it because there is a good chance that we are going to forget to add it to the list the next time that we are going to produce a new one. For now I was thinking to have our frontend produce a list of these, something like
so that I can split them up and do a for loop.

Thank you if you managed to bear with me so far. I hope that the comunity is going to give me some brilliant ideas!

Please sign in to leave a comment.