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!

    Customs Action running on Linux Agent

    Scheduled Pinned Locked Moved Support
    sdklinux
    2 Posts 1 Posters 8 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.
    • ? This user is from outside of this forum
      Guest
      last edited by

      I'm trying to write custom action that would wrap for the wget command and run it on a linux agent.

      My first attempt produced this error, am I using the correct class and call?

      Build 101 for Cusmod Linux 9.4.0 (1/08/2013 4:50:08 p.m.)
      Action Group 1: test
      Action 1: Uses '/usr/bin/wget' to dowload Cusmod/deployment-scripts/Database//*.sh
      Preparing remote servers for execution...
      Preparing DWDCW-DSAS01 for execution...
      Preparing SYBDEV_dwdcs-cmas01 for execution...
      Preparation complete.
      Initializing action...
      An unhandled exception occurred while executing this action: System.InvalidOperationException: Action is not supported on this type of agent (requires IPersistedObjectExecuter) at Inedo.BuildMaster.Windows.ServiceApplication.SlimPlanActionExecuter.RemoteAction_InitializeRemoteConfiguration(Object sender, RemoteConfigurationEventArgs e) at Inedo.BuildMaster.Extensibility.Actions.RemoteActionBase.OnInitializeRemoteConfiguration(RemoteConfigurationEventArgs e) at Inedo.BuildMaster.Extensibility.Actions.RemoteActionBase.OnBeforeExecute(EventArgs e) at Inedo.BuildMaster.Extensibility.Actions.ActionBase.Execute(IActionCancellationToken cancellationToken, ExecutionContext context, ExtensionConfigurerBase extensionConfigurer, Boolean resumeNextOnError, Boolean logErrorsAsWarnings)

      My code looks like this

      public sealed class WGetArtifactoryRemoteAction : CommandLineActionBase
      {
      ...

      protected override void Execute()
      {
          this.ExecuteRemoteCommand("/usr/bin/wget", "-m -e robots=off -nd http://artifactory:8081/artifactory/Cusmod/server/9.4.0/123/Server_9.4.0.123.tar.gz");
      }
      
      protected override string ProcessRemoteCommand(string name, string[] args)
      {
          return this.ExecuteCommandLine(name, args[0], this.RemoteConfiguration.SourceDirectory);
      }
      

      }

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        Hi Andrew,

        The ProcessRemoteCommand method only works when working with .NET-based agents. Behind the scenes, that method will serialize the action and use a sort of remoting to run that method on the remote server. With an SSH-based agent, this is obviously not possible.

        The CommandLineActionBase abstracts a lot of the complexity in executing remote processes. Just ignore the ProcessRemoteCommand method (throw a NotImplementedException) and try run the ExecuteCommandLine method from Execute.

        FYI - this is all being refactored in 4.0, and we're trying to phase out as many ProcessRemoteCommand-based actions as possible.

        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