Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Built-in Variables and global otter script not working



  • Hi,
    I am trying to create an Automated deployments everyday. For that I have created Automatic trigger to run everyday. For that, we have three choices to either create a new build, execute a custom script and Disabled.
    I couldn't pick Create a new build since there are no active releases. For my deployment, I have to create release and build (that is another question on how can I prevent from release from closing after deployment is complete... so that I can use it for Automatic deployments)
    For my custom script, I have created global otter script as seen below:

    General
    {
    Create-Release
    (
    Application: $ApplicationName,
    Pipeline: $PipelineName
    );
    
    Create-Build
    (
        Application: $ApplicationName
    );
    }
    

    When I use that in my Automatic triggers as custom script, it just doesn't work. Am I using built-in variables correctly?
    when I hard-code application name and pipeline, it works.

    Can you please advice me on that?

    Thanks.


  • inedo-engineer

    Hi @ashah_4271 ,

    We could definitely improve our documentation in this area, but let me explain a few things...

    $ApplicationName are $PipelineName contain the name of the application and pipeline in context. What this means is that, if an OtterScript is running within a build deployment, then it will be the name of the application, and the pipeline that the build is being deployed in.

    Your custom build trigger OtterScript is running within an application, which means $ApplicationName will be whatever the name of the current application is. However, it's not running within a pipeline, so $PipelineName will be empty.

    Long story short, you should only need to change $PipelineName to be the name of the pipeline you wish to use.

    All that said, I don't know why Pipeline is required, when there is a default release template. So this can be an area of improvement in that operation as well :)

    Please let me know if this is helpful, and then I will try to log an issue to fix/improve on our ends

    Cheers,
    Nanci



  • Thanks Nanci for your response.
    I exactly don't know how variables are being passed from one step to the other in same block of code to the other. Otter script documentation is not so clear on it.
    I have created separate thread fore that. If you can answer that.
    Setting Runtime Variable From Powershell Script
    Thanks


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation