I need to run on the jenkins groovy script from a repository, that requires authentication. I can access this script using:
curl -u login:pass http://some-groovy-script.groovy
And I run on jenkis any script, that doesn't requires authentication:
java -jar jenkins-cli.jar -s http://jenkins/ groovy http://some-groovy-script.groovy
But it doesn't work if scripts repository requires authentication, I get error 401.
Is there any way to combine this two actions in one and execute script on jenkins?