Octopus does not perform variable substitution and config transformation when deploying package to Offline Package Drop

Hi

My name is Alex. We have a setup where we take a package containing a Windows Forms solution and deploy it to an offline package drop location. The package will then be copied to a citrix client and run from there.

When deploying the package to the offline package drop octopus refuses to do any variable substitution and config transformation. It works in all other scenarios where we create a website or install a windows service for example.

The configuration is as follows

  1. Environment has an offline package drop location
  2. Build step for project where package will be deployed to offline package drop location. This step has enabled “substitute variables in files” and “configuration transforms”.

When looking at the logs no substitution or transform takes place. I have tried with different values in step 2, but realized it doesnt matter since it will never try

We just upgraded to Octopus 3.5.1, but I dont recall it worked before either (not sure though since step configuration was incorrect and in a trial state from our part)

== Success: Step 1: NFS ==
11:26:08 Verbose | NFS completed
|
| Success: Nuget Pick-up location
11:26:08 Verbose | Octopus Server version: 3.5.1+Branch.master.Sha.4feefbec21f18bc1b1908b5721dd03570fec86a6
11:26:08 Info | Deploying package ‘\XXXX\DK-regional\WW\NFS\NFS\Octopus\Test\NFS\0.0.12726\Packages\ALD.Windows.Forms.Nfs.0.0.12726_C2D4B8A33EF3F8408A02300DCEE10257.nupkg’ to machine ‘\XXXX\DK-regional\WW\NFS\NFS\Octopus’
11:26:08 Verbose | Appending deploy-package command to offline-deploy script
11:26:08 Verbose | Creating variables file ‘\XXXXX\DK-regional\WW\NFS\NFS\Octopus\Test\NFS\0.0.12726\Variables\Nuget Pick-up location.NFS.NFS.variables.json’
11:26:08 Verbose | Removing previous offline deployment file ‘\XXXX\DK-regional\WW\NFS\NFS\Octopus\Test\NFS\0.0.12726\Nuget Pick-up location.NFS.Deployments-6400.cmd’
11:26:08 Verbose | Removing previous offline deployment file ‘\XXXX\DK-regional\WW\NFS\NFS\Octopus\Test\NFS\0.0.12726\Nuget Pick-up location.NFS.Deployments-6400.ps1’
11:26:08 Verbose | Adding journal entry:
|
|
| == Success: Step 2: Database migrations ==

XXXX is a file share

Really appreciate any help!

Best regards

/Alex

nuget_pickup.png

deploy_package.png

log1.png

Hi Alex,

Thanks for getting in touch. The variable substitution and transforms for offline drops do not take place until the offline drop is executed on the target system. At that time the variables file is loaded and applied to the extracted package contents.

If the substitution is not taking place at that time, could you give me some more context around the log screenshots you have provided and attach the log output of the executed offline package.

Hope that helps,

Rob

Hi Rob

Thanks a lot for the quick reply. What you say explains a lot to me. I just verified our process which is visualized in the new attachments

  1. Octopus is used to deploy a package. As seen in extracted_package.png octopus nicely creates a package including calamari, a .cmd file and powershell script

  2. We use a custom tool to extract the nuget package directly to our deploymentfolder and run the windows form application directly. As I understand from you Rob, this is not the desired way, as we will miss out the variable substitution and config transformation

Currently we dont have any substitutions to do in config files because values are saved in a settings.settings file, which is embedded in the assembly. However we want to get rid of this approach and save values in octopus and thus do the transformations

Could you please tell in short or refer to documentation how we can accomplish to do substitution before we copy the content to the deployment folder? I guess it has something to do with using Calamari and the powershell script?

best regards

/Alex

nugetpackage.png

config_files.png

Hi Alex,

Ah I understand. All the files that are dropped into the offline folder drop should be copied to a temporary location on the destination machine. The cmd file should then be run to continue the deployment process.

The end effect is as if the deployment was done to the machine via a tentacle. The cmd file just takes the place of the tentacle, bootstrapping the deployment process on the remote machine. Therefore you can control the install directory and other variables as you would on a normal deployment.

There are some caveats, but they are spelled out in the Offline Package Drop doco

Hope that helps,

Robert W