Build Information

Hi,

This is what I got when I enable verbose logging

10:50:36 Pushing build informaiton, please wait… [Pipeline] octopusPushBuildInformation 10:50:36 INFO: Creating octopus.buildinfo in D:\Jenkins\workspace\UMSTest_bugfix-Sept2020 10:50:36 INFO: Serializing Octopus build information 10:50:36 INFO: Serialized Octopus build information - { 10:50:36 “BuildEnvironment”: “Jenkins”, 10:50:36 “Branch”: “${GIT_BRANCH}”, 10:50:36 “CommentParser”: “GitHub”, 10:50:36 “BuildNumber”: “13”, 10:50:36 “BuildUrl”: “https://****************/job/UMSTest/job/bugfix-Sept2020/13/”, 10:50:36 “VcsType”: “Git”, 10:50:36 “VcsRoot”: “${GIT_URL}”, 10:50:36 “VcsCommitNumber”: “${GIT_COMMIT}”, 10:50:36 “Commits”: [ 10:50:36 { 10:50:36 “Id”: “54b5e1b76c3126432cac2eeb6b2185756654da1f”, 10:50:36 “Comment”: “MHSABU-1234- use octpusdeploy for build info” 10:50:36 } 10:50:36 ] 10:50:36 }

Regards,

Hey,

I ran a test on my own setup. Octo Plugin 3.1, Jenkins version 2.235.2, Ubuntu server.

Here is my step:

Here is the output and results:

INFO: Serialized Octopus build information - {
  "BuildEnvironment": "Jenkins",
  "Branch": "origin/master",
  "CommentParser": "Jira",
  "BuildNumber": "78",
  "BuildUrl": "http://localhost:8080/job/RandomQuotes/78/",
  "VcsType": "Git",
  "VcsRoot": "https://github.com/xxxxxxxx/RandomQuotes-Java.git",
  "VcsCommitNumber": "ed55da24647128bfe0e835e538f3e53824c62e97",
  "Commits": [
    {
      "Id": "54461c84b55059d5cc1af0bb3be6ed77d72d223e",
      "Comment": "Set up CI with Azure Pipelines"
    },
    {
      "Id": "8f0178f907a5843cc6beaf5632bc59783780eb5b",
      "Comment": "Update azure-pipelines.yml for Azure Pipelines"
    },
    {
      "Id": "f32a47aecb264a5345015518f92ebb575bb817e3",
      "Comment": "Update Jenkinsfile"
    }, ......

image

It appears to work on my end. Is yours setup similarly? It looks like the ${GIT_BRANCH} variable isnt evaluating for some reason in your pipeline.

Thanks,
Jeremy

Octopus plugin 3.1.0, Jenkins 2.249.2, windows server

below is the syntax I use to push the build info

octopusPushBuildInformation additionalArgs: ‘’, commentParser: ‘GitHub’, overwriteMode: ‘OverwriteExisting’, packageId: ‘Vosco.Ums.Web.Setup’, packageVersion: “${vNumber}”, serverId: ‘OctopusDeploy’, spaceId: ‘Spaces-2’, toolId: ‘Octocli’, verboseLogging: true

Regards,

by the way, I am not using free style project in Jenkins. rather I am using jenkinsfile (pipeline as a code). So, I don’t have setting like yours.

Hi,

Sorry I’m not very familiar with the jenkinsfile syntax, but I took a look at our documentation. https://octopus.com/docs/packaging-applications/build-servers/jenkins/pipeline#build-information

It looks like a lot of the fields are covered in the syntax shown there. Is there a reason you’re passing them as additional args? Or is it just the format of the reply that makes it look that way?

This is the example:

octopusPushBuildInformation \
  toolId: 'octocli', \
  serverId: 'octopus-server', \
  spaceId: 'Spaces-1', \
  commentParser: 'GitHub', \
  overwriteMode: 'FailIfExists', \
  packageId: 'OctoPetShopService', \
  packageVersion: '1.2.${BUILD_NUMBER}', \
  verboseLogging: false, \
  additionalArgs: '--debug', \
  gitUrl: 'https://github.com/OctopusSamples/OctoPetShop', \
  gitBranch: '${GIT_BRANCH}' \
  gitCommit: '${GIT_COMMIT}'

This section also may be our issue:

Git Branch isnt getting correctly parsed in yours.

Could you take a look at the documentation and let me know if you see any differences in how you have it setup and how its recommended there?

Thanks,
Jeremy

Hi @endashaw.adane,

@jeremy.miller is correctly, you’ll need to extract the Git related information in the pipeline itself and pass it to octopusPushBuildInformation.

Hi,

I passed the Git related information and working as expected!

I really appreciated your support and thank you for including the branch info in the plugin.

Regards,

Hi,

You’re very welcome. Thank you for updating us that it’s working. My apologies on forgetting you were using pipelines.

I hope you have a great rest of your week.

Thanks,
Jeremy

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