Move 1 pre-created file from TC to Octo

#1

I am trying to figure how how can I move a prepackage nupkg file (created in previous step in TC) and push it to Octopus.
I am not looking for TC to recreate the package with this command “/**/* => abb.nupkg”. I am looking to take “C:\aaa\bbc.nupkg” and push it into Octopus and down the road to ProGet.

I am using:
Team City v2018.2.2.61245
Octopus v2018.10.1 LTS

(Matthew Casperson) #3

Hi @RK, thanks for reaching out.

You can reference existing files in the OctopusDeploy: Push Packages step. As an example, in the screenshot below you can see the file C:\aaa\bbc.nupkg referenced directly in the step.

Pushing files to an external Nuget repository would use something like the Nuget publish step, which is documented at https://confluence.jetbrains.com/display/TCD18/NuGet+Publish.

Regards
Matt C

#4

Hi Matt

Variable
%BuildOutputDirectory% - “%system.teamcity.build.checkoutDir%.Publish”
%OctopusPackagePath% = “%OctopusPackageName%.%OctopusPackageVersion%.nupkg”

Here are the screen shots…

The build logs “Please specify a package to push”.
I also tried hard coding absolute path, still does not work. I verified path is correct.

(Matthew Casperson) #5

Hi @ryank,

Can you attach the Team City log files? Specifically the line in the log files that says something like:

Running command:   octo.exe push --server https://octopusserver --apikey SECRET --package C:\buildAgent\work\a37d4dbb378037a8\package.nupkg 

This will show the command that was run as part of the push step, and may highlight why the step is not working as expected.

Regards
Matt C

#6

I just learned that have multiple Octopus variable within an Octopus variable - it does not resolve correctly. The screen shot below is what I have in the step field “Package Path”

(Matthew Casperson) #7

Hi @ryank

The lack of a --package argument to the octo push command indicates that Team City could not resolve the supplied package paths to a file. Paths that don’t exist are ignored, and in this case because there is just one path, this means no packages are passed to the octo push command.

I would recommend adding a Powershell step before the Octopus Push step to print the value of any variables you are using, and to verify that the files exist. In the screenshot below I have a simple Powershell step that prints the value of the %teamcity.build.workingDir% variable, and uses a ls command to verify that the file exists.

You can then see in the build logs the value of the variables and a directory listing showing the test.txt files does exist.

Regards
Matt C

(system) closed #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.