I want to have a step in my process that reads in a package from a feed, extracts it like it’s deploying it on a tentacle, replaces all the variables like it would normally, then zips it up and moves it to the Azure Table Storage.
I’ve currently got this working deploying the packages to random tentacles, but this slows it down considerably (uploading the files unnecessarily to tentacles, less processing power in general per tentacle).
This would be very similar to the Azure Cloud Service as described here. The deployment process would be slightly different to adjust for no cloud service being involved of course:
Download the NuGet package from the NuGet server
Extract the NuGet package on the Octopus server to a temporary location
Any configured or packaged PreDeploy scripts are executed
Substitute variables in files (if configured)
XML configuration transformations (if configured) are performed
XML configuration variables (if configured) are replaced
Any configured or package Deploy scripts are executed
Re-package the folder (zip)
Upload zip file to Azure Storage
Any configured or packaged PostDeploy scripts are executed
I’ve been unable to crack at this with the provided Action Types, it seems the default ones that involve the replace config steps are also fixed on a tentacle, while the built in Azure Cloud Service target doesn’t seem to have this.
Thoughts? Is this an action type that is hidden? Would it be a new feature?
We don’t have any hidden action types, so if you were needing a custom implementation, this would be a new feature that you could suggest via uservoice. If your suggestion gets enough community support/votes, we will consider adding it as a feature in a future version of Octopus.
However, if it’s just the cloud-service deployment part that you need to modify, you could potentially customise the DeployAzureCloudService script that gets run in your deployment (see the “Customizing the deployment process” section of the Cloud Service deployment step documentation for details)
Basically, you copy our DeployAzureCloudService.ps1 script from Calamari into your package as DeployToAzure.ps1 (and customise as you wish to call Azure Table Storage cmdlets). Octopus will then invoke this custom script instead of the default script during a cloud-service deployment.
Is that something that could potentially help in your situation?
There are official Octopus Azure step templates (such as Deploy an Azure Cloud Service, Deploy an Azure Web App, Run an Azure PowerShell Script and Deploy an Azure Resource Group). These steps are all executed through an open-source library called Calamari if you’re interested in how Octopus is calling through to Azure (eg. see these commands).
But if you were looking to create a custom step, you could search the community library for the keyword Azure and there are many community-contributed step templates that you could potentially base yours on (some useful documentation on getting started is here. You can click into a given step template from the library, then click the “Show script” link to see their script and get some ideas.