Jenkins Pipeline support - Build Information

What is the status on this post? How does one generate the build information when using the Jenkins pipeline? Is our only option to manually generate the json?

I can see, that if I’m not using pipelines, Octopus plugin generates the file. But how do we do that in a pipeline?

Hi @jmichael,

Welcome to the Octopus boards!

We have a recent blog on the subject of Jenkins Pipelines and it shows an example of build information: https://octopus.com/blog/using-jenkins-pipelines

Could you please take a look at the code example and explanation and let me know if you’re able to adapt it to your pipeline?

Thanks,
Jeremy

I have not done the custom install script, I installed the Octopus CLI on the server manually for now.
I’ve configured the tools, and it works if I’m using a free style project with the build-information step.

When I run it from a pipeline, using the octo.exe build-information, it can’t locate the buildinfo.json (because it doesn’t exist).

When I run from pipeline using plugin, I get
[Pipeline] octopusPushBuildInformation (hide) FATAL: Failed to push the build information: null

When I run from from Jenkins Script console:
println (octopusPushBuildInformation additionalArgs: ‘’, commentParser: ‘Jira’, overwriteMode: ‘OverwriteExisting’, packageId: ‘my.packagename’, packageVersion: ‘my.package.version’, serverId: ‘my.octopus.server’, spaceId: ‘Spaces-1’, toolId: ‘Default’, verboseLogging: true, giturl: ‘my.git.url’, gitcommit: ‘my.gitcommit’)

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: additionalArgs @ line 1, column 38.

Jenkins 2.204.5
Octopus Deploy Command Line Tool, version 7.4.1
Handshake successful. Octopus version: 2020.3.2; API version: 3.0.0

Hey @jmichael,

Could you please private message me your jenkinsfile for your pipeline so I can dig in and see what’s possibly going on here?

Thanks,
Jeremy

I was finally able to find my problem, I used the syntax generator in Jenkins, and it defaults to generating values with single quotes. When I substituted those values with variables ‘${myvariable}’, the process fails with no really output, thus the null above.

Changing to double quotes around my variable values resolved the problem for me. “${myvariable}”

1 Like

Hey @jmichael,

Thanks so much for updating me with the solution. I’m glad to hear you got it worked out.

We’re here if you run into anything else and need help.

I hope you have a great rest of your week.

Thanks,
Jeremy