Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    3 Posts 2 Posters 14 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      ashah_4271
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • NanciCaloN Offline
        NanciCalo inedo-engineer
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • A Offline
          ashah_4271
          last edited by

          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

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • First post
            Last post
          Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation