I cannot make jenkins_cli to launch groovy scripts.
I have tried many connection methods but each time I get a "This command is requesting the deprecated -remoting mode" even-though I am not using this connection method.
For instance, I tried with SSH connection:
I have disabled the remote connection mode & I started SSHD on a fixed port. (see config.png attachement)
I have then put my ssh public key in my user settings.
"help" command works fine:
ssh -l <MyUserName> -p <MyFixedSSHDPort> <JENKINS_HOST_MACHINE_NAME> help
With this I receive the help of jenkins_cli.
"who-am-i" command confirms I am correctly authenticated:
ssh -l <MyUserName> -p <MyFixedSSHDPort> <JENKINS_HOST_MACHINE_NAME> who-am-i
Authenticated as: <MyUserName>
The problem is when I try this:
ssh -l <MyUserName> -p <MyFixedSSHDPort> <JENKINS_HOST_MACHINE_NAME> groovy MyScript.groovy
It fails with this error:
ERROR: This command is requesting the deprecated -remoting mode. See https://jenkins.io/redirect/cli-command-requires-channel
I also tried with -auth, -http, I always get this same error message.
No error is logged in jenkins logs
Looks like a bug to me but any suggestion or workaround is welcomed.