Manually pushing packages

execution

(Tony Alaniz) #1

We have a setup that requires the use of 1 dynamic package, we are currently using a NuGet server to pull this package from within our network. As we branch out to other clients that are not hosted with us, we’re looking for a solution that requires less overhead (not having to adjust our firewall for every new host). Is it possible to use Octopus.Client or Calamari to manually push a package from our repository to a tentacle? We believe that this may be the most efficient method as external clients will already have to allow us to communicate over port 10933. I’ve looked through the step template library on github and some of the Calamari and Octopus.Client/Server commands, but am having a difficult time figuring out how we would manually trigger the push. Since the packages are dynamic and have to be built at deployment run time, we can’t use the artifact gathering step at the beginning of each deployment to collect the package.


(Tom Williams) #2

Hi Tony,

Thanks for reaching out, We dont currently have any inbuilt support for the scenario you are describing, however there might be a work around that could work.
The package acquisition step (where the packages are collected up to be transferred) only happens just before the first “Deploy a Package” step, so technically you could create the package and publish it to your external feed in the first step of you deployment, as long as that step occurs before any deploy package steps.
You would also need to select the option to deploy the package from the Octopus Server so that the tentacle doesn’t need to communicate with the NuGet server.

here is some sample code that pushes a package to the Octopus internal package feed, this could be run during the first step in a deployment.

$ver = $OctopusParameters["Octopus.Action[Deploy].Package.NuGetPackageId"]

//run scripts to build a package using the version specified in the deployment
cp D:\test-package.0.0.1.zip D:\dummy.$ver.zip

//run a command to upload to the package feed being used.
octo.exe push --package D:\dummy.$ver.zip --server http://localhost:8065 --user admin --pass Password01!

Hopefully I have understood your question. I hope that helps, please let me know if you have any further questions,

Kind Regards,
Tom W