Jenkins plugin send variable to octopus deploy

I am using Octopus Plugin in Jenkins and start deployment from jenkins.
I am passing variable from jenkins branch_name=$BRANCH_NAME.
I have setup variable at project level branch_name but it is coming empty.
How do map variable value from jenkins to octopus project level variable

1 Like

Hi @chiraggb,

First of all, welcome to the Octopus forums!

Thanks for reaching out.

The easiest way for you to pass a variable to Octopus from your Jenkins pipeline would be to configure a prompted variable in Octopus, then as part of your pipeline you can pass that along in the create release step or the deploy step. You would need to add the required parameters in the additional arguments sections of your Octopus step in Jenkins. This method requires that you will be deploying from your build pipeline and not just creating the release. The downside is that the prompted variables will need to be set if you promote to other environments if you deploy those manually via the portal.

Depending on if all you need is the Branch Name, you could potentially utilize a Push Build Information step from the Octopus plugin in Jenkins. This will include the branch name from your repository, then you can reference that build information on the package from within the deployment.

Can I please get a high-level overview of your use case to see if maybe there’s a different solution I can give you? Are you only trying to get the branch name to Octopus to key things in your process off of it?

Please let me know if that information helps or if you have any other questions or concerns.

Best,
Jeremy

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