Running CURL Through Rundeck

919 views
Skip to first unread message

Prashil

unread,
May 24, 2021, 8:45:34 AM5/24/21
to rundeck-discuss

Hi Team,

Can someone help mein running a curl command through rundeck in a windows machine....
Curl is running properly through command pompt and through batch files but rundeck is not recognizing the same...
Tried various trial and error through google but nothing worked.

Regards,
Prashil

rac...@rundeck.com

unread,
May 24, 2021, 9:09:36 AM5/24/21
to rundeck-discuss
Hi Prashil,

Try to launch the command from an inline-script ("Script" step) instead of a command step,  make sure to set "powershell.exe" on the "Invocation String" textbox and ".ps1" on the "Extension" textbox (both available by clicking on "Advanced" button), save and test.

Hope it helps!

Prashil

unread,
May 24, 2021, 11:05:41 AM5/24/21
to rundeck-discuss
Thanks,

New error now....

I am trying
curl -v -u username:password https://XXXXXXXXXXXX.com/repository/release/test/ --upload-file E:\PATH TO FILE\Filename.zip

And getting error
1. Script    Invoke-WebRequest : Parameter cannot be processed because the parameter name
'u' is ambiguous. Possible matches include: -UseBasicParsing -Uri
-UseDefaultCredentials -UserAgent.
At C:\WINDOWS\TEMP\1-1925-XXDEVOPSTEST01-dispatch-script.tmp.ps1:2 char:9
+ curl -v -u username:password https://XXXXXXXXXXXXXXXX...
+         ~~
 + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], Parame
  terBindingException
    + FullyQualifiedErrorId : AmbiguousParameter,Microsoft.PowerShell.Commands
   .InvokeWebRequestCommand


When tried modified command
curl -v -UserAgent username:password https://XXXXXXXXXXXX.com/repository/release/test/ --upload-file E:\PATH TO FILE\Filename.zip

New error
Invoke-WebRequest : A positional parameter cannot be found that accepts
argument '--upload-file'.
At C:\WINDOWS\TEMP\3-1927-XXDEVOPSTEST01-dispatch-script.tmp.ps1:2 char:1
+ curl -v -UserAgent username:password https://XXXXXXXXXX ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], Parame
   terBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell
   .Commands.InvokeWebRequestCommand

rac...@rundeck.com

unread,
May 24, 2021, 11:45:39 AM5/24/21
to rundeck-discuss
Hi Prashil,

You're facing this. Take a look at this and this.

Another approach is to pass the parameters on the "Arguments" textbox on your Rundeck job.

Regards!

Michael Bartikyan

unread,
May 24, 2021, 1:05:24 PM5/24/21
to rundeck-discuss
Try
Reply all
Reply to author
Forward
0 new messages