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!

    Gitlab::Get-source is different between BM and Otter for credentials

    Scheduled Pinned Locked Moved Support
    otterbuildmastergitlab
    9 Posts 4 Posters 22 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.
    • P Offline
      philippe.camelio_3885
      last edited by

      Hello
      I was looking to create a shared libray with Otter and BM and I meet the following probem with the Gitlab extension:
      The credentials are not call in the same way, so it is not possible to share it.

      In Otter:

                      GitLab::Get-Source
                      (
                          Credentials: gitlab-inedo,
                          Group: ansible/playbooks,
                          Project: $tolower($PLAYBOOK),
                          DiskPath: $DOSSIER,
                          Branch: master,
                          KeepInternals: false,
                          GitExePath: /usr/bin/git,
                          CleanWorkspace: true
                      );
      

      in BuildMaster:

      GitLab::Get-Source global::GitLab
      (
          Namespace: ansible/playbooks,
          Project: $tolower($PLAYBOOK),
          DiskPath: $DOSSIER,
          Branch: master,
          KeepInternals: false,
          GitExePath: /usr/bin/git,
          CleanWorkspace: true
      );
      

      When do you think the extension will be the same ?
      I can bypass the problem, it is just to know.

      Best regards
      PhilippeC.

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

        Otter uses Inedo.SDK 1.6, where as BuildMaster is on Inedo.SDK 1.7. The major addition to 1.7 is SecureResources and SecureCredentials, which replace ResourceCredentials. However, it's still backwards compatible.

        The current (1.7) version of GitLab::Get-Source has two changes:

        • Changed Credentials property to From (but keeps Credentials as an alias)
        • Added From as the default property, so it will be used as argument right after the operation name

        This keeps it backwards compatible.

        We will add SDK 1.7 to Otter later this year, but in the mean time you can use the Otter version code and create a ResourceCredential in BuildMaster of the same name.

        P 1 Reply Last reply Reply Quote 0
        • P Offline
          PhilippeC. @atripp
          last edited by

          @atripp
          Thanks for the reply

          1 Reply Last reply Reply Quote 0
          • P Offline
            philippe.camelio_3885
            last edited by

            Hello @atripp

            I was still looking trying to share the same library in OTTER and Buildmaster despite the difference of the function Gitlab::source.
            Is it possible that you create a built-in variable like

            $InedoProgram=<Otter | BuildMaster>
            

            in some next release, so I could bypass the problem in my module like this.

            If $InedoProgram = Otter
            {
                    # OTTER
                    {
                        GitLab::Get-Source
                        (
                            Credentials: gitlab-inedo,
                            Group: ansible/playbooks,
                            Project: $tolower($PLAYBOOK),
                            DiskPath: $DOSSIER,
                            Branch: master,
                            KeepInternals: false,
                            GitExePath: /usr/bin/git,
                            CleanWorkspace: true
                        );
                    }
            
            }
            else
            {
                    # BUILDMASTER
                    {
                    GitLab::Get-Source global::GitLab
                    (
                        Namespace: ansible/playbooks,
                        Project: $tolower($PLAYBOOK),
                        DiskPath: $DOSSIER,
                        Branch: master,
                        KeepInternals: false,
                        GitExePath: /usr/bin/git,
                        CleanWorkspace: false
                    );
            }
            

            I did the trick with my own variable but it would be nice to have such variable.

            " small steps for Inedo, giant leap for me" 😊

            Best Regards
            PhilippeC.

            1 Reply Last reply Reply Quote 0
            • rhessingerR Offline
              rhessinger inedo-engineer
              last edited by

              Hi @philippe-camelio_3885,

              Do you know how to create your own extension? If not, check out creating an extension using the SDK.

              To create an $InedoProduct and $InedoProductVersion variables, you can create a couple of new classes extending Inedo.Extensibility.ScalarVariableFunction. Then simply implement the ExecuteScalar method and have it return Inedo.SDK.ProductName or Inedo.SDK.ProductVersion. You can see an example of this with the ServerNameVariableFunction in the Inedox-InedoCore extension on GitHub. If you can submit a pull request, I'll be happy to test it and get it published right away!

              Thanks,
              Rich

              Products Engineer, Inedo

              1 Reply Last reply Reply Quote 0
              • P Offline
                philippe.camelio_3885
                last edited by

                Hi @rhessinger

                I am an old sysadmin so I am really not fluent with .Net stuff and I don't have VS on my computer 😬
                but you give me a good starting point, I will make a try.

                Best Regards
                PhilippeC.

                1 Reply Last reply Reply Quote 0
                • P Offline
                  PhilippeC.
                  last edited by

                  Stupid question : is it possible to use VSCode to compile inedo extension ?

                  1 Reply Last reply Reply Quote 0
                  • rhessingerR Offline
                    rhessinger inedo-engineer
                    last edited by

                    Hi @philippe-camelio_3885,

                    Technically you can use VSCode, but you will still have to at least install the MS Build Tools for Visual Studio 2019. Then you will have to run the msbuild.exe to compile your code. Here is Microsoft's guide for how to work with C# in VSCode. Hope this helps!

                    Thanks,
                    Rich

                    Products Engineer, Inedo

                    P 1 Reply Last reply Reply Quote 0
                    • P Offline
                      PhilippeC. @rhessinger
                      last edited by

                      @rhessinger
                      Thanks a lot.
                      I will try it.

                      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