Output variable access

Santosh Kumar's Avatar

Santosh Kumar

18 Aug, 2017 02:05 AM

Hi Guys,
Is it possible to set an output variable from a C# code (using Octopus.Client ) and then access it back on Octopus server?

Problem : I am invoking an exe (console application) as a step and then i want to set a variable to true / false. Based on this i want to either skip or execute the next step in my deployment process.
Thanks for your help.

Santosh

  1. Support Staff 1 Posted by Daniel Fischer on 21 Aug, 2017 01:45 AM

    Daniel Fischer's Avatar

    Hi Santosh,

    Thanks for getting in touch! This will not be possible as you intend, as setting output variables is a calamari feature. Invoking it from Octopus.Client is not possible. I may have a solution here though.

    Is it possible to assess the condition for setting the output variable outside of the application you are installing? If so, I believe the easiest way to achieve this is to use some custom scripting in your step. You can use the custom script to check that the application has executed correctly or done what is needed, then as a result you can create the output variable to be evaluated on the next step as a variable run condition.

    Here is a link to our documentation on custom script. https://octopus.com/docs/deploying-applications/custom-scripts

    Please let me know if I have missed anything here or if you have any further questions. :)

    Best regards,
    Daniel

  2. 2 Posted by Santosh Kumar on 21 Aug, 2017 06:15 AM

    Santosh Kumar's Avatar

    Hi Daniel,
    Thanks for the response. I am able to achieve this my exiting my code with error code and in turn skipping the next step. I was trying to see if we can use the Output variables and achieve the same.
    Regards,
    Santosh Kumar

  3. Support Staff 3 Posted by Daniel Fischer on 22 Aug, 2017 12:10 AM

    Daniel Fischer's Avatar

    Hi Santosh,

    Thanks for getting back. No worries at all. Let me know if you have any further questions.

    Best regards,
    Daniel

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac