hi @wg,
I think the way to go about this will be to have two separate projects. You will need to configure your ODP target to create an Artifact rather than a Drop Folder to use the logic below.
The first project(Project A) will create the offline package artifact that we will later FTP.
The second project(Project B) will then be a meta project, which will be the one you will run. The steps will be:
Step 1. Deploy a release in Project A.
Step 2. Using API calls, gather the artifact from the release from Project A, then run your FTP commands.
Here is some code to help you get Step 2 accomplished:
$header = @{ "X-Octopus-ApiKey" = $APIKey }
$artifactUrl = "$OctopusUrl/api/$SpaceId/artifacts?take=2147483647®arding=$ProjectId&order=dec"
$artifactResponse = Invoke-RestMethod $artifactUrl -Headers $header
APIKey, ProjectId, SpaceId, and OctopusUrl you will have to supply. You can get the project Id of Project A from [Octopus.Action[STEPNAME IN PROJECTB THAT DEPLOYS PROJECTA].DeployRelease.ProjectId] from within Project B. You can get SpaceId from [Octopus.Space.Id].
Once you have artifactresponse, the first artifact should be the latest but putting some checks in there is suggested. Iterate through to get the artifact ID. You will take the desired artifact ID, and you will then Get-Content on that (api/SPACEID/artifacts/ARTIFACTID/content) and do whatever FTP work needs to be done.
If you only apply the above logic, you will have to create a release in Project A before creating a release and deploying Project B. Project B will only deploy a Project A release, not create the release. You can add a step before Step 1 and 2 in Project B that will create a new release if you want to automate it further. That will be done with API calls. Here is an example to get you started on creating a release with an API call if you want to go that way.
As always, please test all script recommendations we give you to make sure you are getting desired results before using in production.
Please let me know if this will work for you or if you need any further assistance.
Thanks,
Jeremy