Re: Help with invoking scripts via CURL

2016-10-10 Thread Naveen
Victor, Thank you! That didn't work. When I replace the password with token
it is working,not with the password.

On Mon, Oct 10, 2016 at 8:58 AM Victor Martinez <
victormartinezru...@gmail.com> wrote:

> I normally use:
>
> instance=http://192.168.99.100:31419
>
> 
> USER=
> PASS=Y
> curl --silent --user "${USER}:${PASS}" --data-urlencode
> "script=$(<./whatever.groovy)" ${instance}/scriptText
>
> Cheers
>
>
> On Monday, 10 October 2016 01:35:55 UTC+1, Naveen Srinivasan wrote:
>
> Hi,
>
>   I am trying to automate Jenkins fully using helm and kubernetes
> https://github.com/kubernetes/charts/tree/master/stable/jenkins . By
> doing this the admin password is available via kubernetes   secretes.  The
> goal is to automate bringing up jenkins without logging into the server
> manually. As part of that I would like to execute scripts pointing to
> jenkins server.
>
>
> When I try to use admin with password
> curl --data-urlencode "script=$(<./test.groovy)" http://admin:cEunYtfPfP@
> http://192.168.99.100:31419/scriptText
>
>
> I am getting an exception
> hudson.security.AccessDeniedException2: anonymous is missing the
> Overall/Read permission
> at hudson.security.ACL.checkPermission(ACL.java:65)
> at hudson.model.Node.checkPermission(Node.java:464)
> at jenkins.model.Jenkins.getTarget(Jenkins.java:4426)
> at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:674)
> at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
>
>
>  Where as If I login into the server and get the API token for admin then
> the same code works if i use the API token.
> curl --data-urlencode "script=$(<./test.groovy)"
> http://admin:b8d84d283000b5ce7b446a756f820352@192.168.99.100:31419/scriptText
>
> What am I doing wrong? Is this possible?  Like I had mentioned I would
> like to use automate everything without ever logging into the server.
>
> Thank you!
> Naveen
>
>
> 0 New
> Reply to all
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-users/M3z5AmhXN1g/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/26b92dfa-95eb-45b8-bb0b-a4d076151b9e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAEDdFggHXLx1o9Z%3DBozmN88cA_p2ZyOFpe-vFam1iePcp0oZmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help with invoking scripts via CURL

2016-10-10 Thread Victor Martinez
I normally use:

instance=http://192.168.99.100:31419

USER=
PASS=Y
curl --silent --user "${USER}:${PASS}" --data-urlencode 
"script=$(<./whatever.groovy)" ${instance}/scriptText

Cheers

On Monday, 10 October 2016 01:35:55 UTC+1, Naveen Srinivasan wrote:
>
> Hi, 
>
>   I am trying to automate Jenkins fully using helm and kubernetes 
> https://github.com/kubernetes/charts/tree/master/stable/jenkins . By 
> doing this the admin password is available via kubernetes   secretes.  The 
> goal is to automate bringing up jenkins without logging into the server 
> manually. As part of that I would like to execute scripts pointing to 
> jenkins server.
>
>
> When I try to use admin with password 
> curl --data-urlencode "script=$(<./test.groovy)" http://admin:cEunYtfPfP@
> http://192.168.99.100:31419/scriptText
>
>
> I am getting an exception
> hudson.security.AccessDeniedException2: anonymous is missing the 
> Overall/Read permission
> at hudson.security.ACL.checkPermission(ACL.java:65)
> at hudson.model.Node.checkPermission(Node.java:464)
> at jenkins.model.Jenkins.getTarget(Jenkins.java:4426)
> at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:674)
> at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
>
>
>  Where as If I login into the server and get the API token for admin then 
> the same code works if i use the API token.
> curl --data-urlencode "script=$(<./test.groovy)" 
> http://admin:b8d84d283000b5ce7b446a756f820352@192.168.99.100:31419/scriptText
>
> What am I doing wrong? Is this possible?  Like I had mentioned I would 
> like to use automate everything without ever logging into the server.
>
> Thank you!
> Naveen
>  
>
> 0 New
> Reply to all
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/26b92dfa-95eb-45b8-bb0b-a4d076151b9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help with invoking scripts via CURL

2016-10-09 Thread Naveen Srinivasan
Hi, 

  I am trying to automate Jenkins fully using helm and kubernetes 
https://github.com/kubernetes/charts/tree/master/stable/jenkins . By doing 
this the admin password is available via kubernetes   secretes.  The goal 
is to automate bringing up jenkins without logging into the server 
manually. As part of that I would like to execute scripts pointing to 
jenkins server.


When I try to use admin with password 
curl --data-urlencode "script=$(<./test.groovy)" http://admin:cEunYtfPfP@
http://192.168.99.100:31419/scriptText


I am getting an exception
hudson.security.AccessDeniedException2: anonymous is missing the 
Overall/Read permission
at hudson.security.ACL.checkPermission(ACL.java:65)
at hudson.model.Node.checkPermission(Node.java:464)
at jenkins.model.Jenkins.getTarget(Jenkins.java:4426)
at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:674)
at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)


 Where as If I login into the server and get the API token for admin then 
the same code works if i use the API token.
curl --data-urlencode "script=$(<./test.groovy)" 
http://admin:b8d84d283000b5ce7b446a756f820352@192.168.99.100:31419/scriptText

What am I doing wrong? Is this possible?  Like I had mentioned I would like 
to use automate everything without ever logging into the server.

Thank you!
Naveen
 

0 New
Reply to all

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7e52c4db-8759-4f38-8bcf-028930f76498%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.