4
votes

I am having problems trying to push a .zip artifact from Team City to Octopus Deploy and would like to requisition some help with this.

Using the "OctopusDeploy: Push packages" runner on Team City, I am trying to push the artifact "Release.%MajorVersion%.%MinorVersion%.%build.number%.zip" to our Octopus Server.

This, however, fails with the following error message:

[04:58:19][Octopus Deploy] Please specify a package to push
[04:58:19][Octopus Deploy] Exit code: -1
[04:58:19][Octopus Deploy] Octo.exe exit code: -1
[04:58:19][Step 3/3] Unable to create or deploy release. Please check the build log for details on the error.

In the "Artifacts path" field of the "General Settings" section of the Build Configuration in Team City, I have defined the following artifact to be created:

+:Release => Release.%MajorVersion%.%MinorVersion%.%build.number%.zip
-:Release/**/*.xml => Release.%MajorVersion%.%MinorVersion%.%build.number%.zip

This creates the file "Release.%MajorVersion%.%MinorVersion%.%build.number%.zip" in the path [Team City Data Directory]\system\artifacts[Project Name][Configuration Name][Unique Build Number].

Next, I try to push this package to our Octopus Server by using the "OctopusDeploy: Push packages" runner with the "Package paths" parameter set to "Release.%MajorVersion%.%MinorVersion%.%build.number%.zip", since the descriptive text says "These follow the same rules as TeamCity artifact paths."

However, this does not appear to work.

I would like to know why, and how I could get it to work.

My main problem at this point is that I don't know how I can address the "Release.%MajorVersion%.%MinorVersion%.%build.number%.zip" file in the mutable artifacts directory.

2

2 Answers

3
votes

Short answer

You need to be more specific with the package path in the OctopusDeploy: Push packages step. By simply passing Release.%MajorVersion%.%MinorVersion%.%build.number%.zip you are telling that step to get the package with that name at the root of your workdir. But as you already said, that package is actually sitting on [Team City Data Directory]\system\artifacts[Project Name][Configuration Name][Unique Build Number]

So try passing the full path of the zip file like

[Team City Data Directory]\system\artifacts[Project Name][Configuration Name][Unique Build Number]\Release.%MajorVersion%.%MinorVersion%.%build.number%.zip

replace the values in square brackets with the apropriate TeamCity variable

Long Answer

When it says These follow the same rules as TeamCity artifact paths it means that you can use the same kind of expressions like +:Release => Release.zip to create artifacts. It doesn't mean that It'll look for files into the artifacts' directory.

The OctopusDeploy: Push packages not only allows you to push packages, but also pack them (not that obvious, yeah). So if you put (same) below expression in that field, It'll create the package and push it to the repository

+:Release => Release.%MajorVersion%.%MinorVersion%.%build.number%.zip -:Release/**/*.xml => Release.%MajorVersion%.%MinorVersion%.%build.number%.zip

Additionally if you check the box Publish packages as build artifacts the zip file will also be available as a TeamCity artifact. So you wouldn't technically need need the current step where you are creating the artifact (unless it has another purpose in your build process of course)

enter image description here

0
votes

Make sure you add OctoPack to you project from NuGet Package Manager.