Tenant specific files

This is related to this issue: https://github.com/OctopusDeploy/Issues/issues/2755

We have the need to white-label specific apps, but having to create a package per tenant is probably going to be overkill (and isn’t currently supported anyways). The assets are simply a couple of images and a css file. So far what I have done is have an assets folder somewhere in IIS, and specify that path as a variable. It works, but it just isn’t that clean and requires more manual work to get the first deployment going.

An alternative solution I have come up with is have an assets path somewhere on the disk (optional config variable) and then have a deployment step look in that folder and overwrite matching files (the site would be packaged with some defaults). You do run into the issue that if you have to make changes to an asset, you have to then copy it to the latest installed package folder (or maybe use the new ability to run a step template outside of a deployment). You also need to make sure this folder is available if you are deploying the same site across many machines (file share, etc)

Curious to hear what other solutions people have to this problem.

Hi Mark,

Thanks for reaching out. Until we come up with an approach in that github issue, a possible workaround could be to have a folder with assets per tenant inside of your (single) package, and then using a Powershell script during the deployment to:

  1. Fetch the assets that belong to the current Tenant using the tenant name given by the variable $OctopusParameters['Octopus.Deployment.Tenant.Name']. For this It’ll be important that inside of the package the folder with the custom assets has the same name as the tenant.

  2. Copy those assets to the needed dir.

  3. Delete all the other assets folders that belong to other tenants.

Let me know if you think that approach will work for you.