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!

    Help with Git raft in Otter

    Scheduled Pinned Locked Moved Support
    26 Posts 5 Posters 57 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.
    • G Offline
      gurdip.sira_1271
      last edited by atripp

      I will give that a read.

      Two questions;

      1. How does Otter handle jobs that may require reboots in betwen/ For example, joining a domain.

      2. I have added some text files to my git repo but Ot

      One last question - in my git raft, I have a script that looks like this:

      $chocoPackages = $PSScriptRoot + "\chocoPackages.txt"
      
      $DB = Get-Content $chocoPackages
      
      foreach ($Data in $DB) {
      choco install $DB -y
      }
      

      However, I get the error:

      Cannot find path 'C:\chocoPackages.txt' because it does not exist.

      What am I missing?
      Oneter reports them as unknown file type.

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @gurdip.sira_1271
        last edited by

        Hi @gurdip-sira_1271

        There is a Restart-Server OtterScript operation that you can use. You can specify a timeout/timer.

        You'll want to store that chocoPackages.txt file as a script asset, and then deploy it to the server you're running the scripts on:

        Get-Asset chocoPackages.txt
        (
            Type: File
        );
        

        However, you may want to consider this approach for your chocopackges:

        https://docs.inedo.com/docs/otter-howto-ensure-chocolatey-packages

        1 Reply Last reply Reply Quote 0
        • G Offline
          gurdip.sira_1271
          last edited by

          I guess the bit I am confused about is if a restart is needed mid script. Would the agent on the server resume the script post reboot?

          For script assets, how would I reference from my Powershell script? Or should I use OtterScript and then have the step above and then my script?

          1 Reply Last reply Reply Quote 0
          • G Offline
            gurdip.sira_1271
            last edited by

            To add, I get this error when making a job template:

            "KillerGamingWindowsPowershell::JobTemplate::KillerGamingWindowsPowershell::Jobs/t" is not a valid raft item identifier.

            Sorry for all the questions, just trying to get myelf up and running!

            1 Reply Last reply Reply Quote 0
            • G Offline
              gurdip.sira_1271
              last edited by

              In addition, when I drag a ps1 script in an otterscript orchestration, the popup is blank and i can't add the script. eg:

              blank.PNG

              1 Reply Last reply Reply Quote 0
              • atrippA Offline
                atripp inedo-engineer
                last edited by

                Hi @gurdip-sira_1271,

                I guess the bit I am confused about is if a restart is needed mid script. Would the agent on the server resume the script post reboot?

                You would need to perform the restart in OtterScript.

                for server REMOTEMACHINE
                {
                   PSCall MyScript1.ps1;
                
                   Restart-Server;
                
                   PSCall MyScript2.ps1;
                }
                

                For script assets, how would I reference from my Powershell script? Or should I use OtterScript and then have the step above and then my script?

                In this case, you'll want to use OTterScript to deploy the script assets first.

                To add, I get this error when making a job template:

                That's a regression, and we'll fix it pretty soon. It has to do with Job Template folders in Git Rafts. We're shipping Otter v2022 today actually :)

                In addition, when I drag a ps1 script in an otterscript orchestration, the popup is blank and i can't add the script.

                Does your script have any parameters? If so, that is to be expected. Its should save if you hit the save button however. Note that in Otter v2022, shipping very soon, the script editor is totally rewritten and should be fixed.

                Cheers,
                Alana

                1 Reply Last reply Reply Quote 0
                • G Offline
                  gurdip.sira_1271
                  last edited by gurdip.sira_1271

                  Ok thanks, I will try otter v2022.

                  The bit I am not sure about is what my ps1 code should look like for the file reference to the text file.

                  The script has no parameters. The behaviour seems a bit erratic. Are you referring to v3.0.24? As I tried this and no change.

                  atrippA 1 Reply Last reply Reply Quote 0
                  • atrippA Offline
                    atripp inedo-engineer @gurdip.sira_1271
                    last edited by

                    Hi @gurdip-sira_1271 ,

                    If your script has no parameters, then there's nothing to really show on the Visual Editor. However, you should be able to save the statement.

                    Behind the scenes, the visual editor should just make a PSCall Set-WebServer; in text mode. What does the text mode look like?

                    Cheers,
                    Alana

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      gurdip.sira_1271
                      last edited by

                      Hmm, nothing in text mode, but I have to cancel and then view.

                      The other confusing thing is with multiple git-based rafts, it's not clear which script is part of which raft.

                      atrippA 1 Reply Last reply Reply Quote 0
                      • atrippA Offline
                        atripp inedo-engineer @gurdip.sira_1271
                        last edited by

                        @gurdip-sira_1271 it's possible there's a bug in the visual mode with that, especially w/ rafts...

                        Here is how you you would call scripts from another raft:
                        PSCall RaftName::Set-WebServer;

                        When you don't specify a raft name, then Default is used as the raft.

                        1 Reply Last reply Reply Quote 0
                        • G Offline
                          gurdip.sira_1271
                          last edited by

                          @atripp said in Help with Git raft in Otter:

                          PSCall RaftName::Set-WebServer;

                          ok let me try that.

                          1 Reply Last reply Reply Quote 0
                          • G Offline
                            gurdip.sira_1271
                            last edited by

                            OK i get an error stating the script cannot be found. I think that's because in the visual plan, the sript doesn't appear anyway.

                            stevedennisS 1 Reply Last reply Reply Quote 0
                            • stevedennisS Offline
                              stevedennis inedo-engineer @gurdip.sira_1271
                              last edited by

                              Hi @gurdip-sira_1271,

                              Just to let you know, Otter v2022 has been released; from here it'd be best to start a new thread if you have a specific issue -- we'll be happy to help!

                              Steve

                              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
                              • 2
                              • 2 / 2
                              • First post
                                Last post
                              Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation