Help with permissions

2020-04-22 Thread Harvey, Edward Ned
I have a Jenkins freestyle project, and have enabled “trigger builds remotely 
e.g. from scripts” with an authentication token. I’m trying to trigger the job, 
but I keep getting “Authentication required” with this error message:

You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't): hudson.model.Hudson.Read
 ... which is implied by: hudson.security.Permission.GenericRead
 ... which is implied by: hudson.model.Hudson.Administer

I want a script to trigger this job, and I’m using Postman or curl to test the 
trigger now. So unauthenticated is good; security comes from using https and 
having a strong randomly generated authentication token.

On the project, I have enabled project-based security, and have granted all 
permissions to all Authenticated and Anonymous users. So I don’t understand why 
I keep getting that error message. I’ve also tried removing project-based 
security and confirm that the global anonymous read and build permissions are 
granted. So I really don’t understand why I keep getting this error.

When I enable “trigger builds remotely” it says: Use the following URL to 
trigger build remotely: JENKINS_URL/job/myjobname/build?token=TOKEN_NAME or 
/buildWithParameters?token=TOKEN_NAME

I browse to my job, in order to get the JENKINS_URL, and for TOKEN_NAME, I am 
using a randomly generated alphanumeric string, which is in the Jenkins job 
configuration, as Authentication Token, so the complete URL is (with real 
hostname, jobname, authentication token changed):
https://myhost.mydomain/job/myjobname/build?token=maWd5eBG3QPkBrzvmCzM

-- 
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/582369AF-27BF-46B9-858D-4C698C47FB81%40tufts.edu.


Re: Running a bat file

2017-09-15 Thread harvey
Currently I am just trying to create a single build to Start the glassfish 
server. For the same I used a freestyle project and by selecting "Run a 
batch windows command line" in building steps I wrote the following 
commands:

cd c:\glassfish3\bin
call asadmin start-domain

Then I saved the build and executed it. The build completes with status 
success, but the glassfish server remain unstarted.

Other than these steps I haven't done any other steps. I did not set an 
ERROR LEVEL. 

Is there something I am missing ?

Regards,
Harvey

-- 
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/d303caf3-7f66-4f2e-a604-360819d8288d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a bat file

2017-09-14 Thread harvey


On Wednesday, September 13, 2017 at 11:20:55 AM UTC+2, harvey wrote:
>
>
>
> On Tuesday, September 12, 2017 at 7:21:55 PM UTC+2, jer...@bodycad.com 
> wrote:
>>
>> Take care that you are actually chaining batch command. What is chaining 
>> batch, someone somewhere though it would be nice to make this super weird 
>> feature for batch script only (yeah a lot of sarcasm here, the first time 
>> you see this beahavior and realize wtf someone wanted to do this is beyond 
>> total common sense), where you call a batch from another batch script, the 
>> remaining in between one can be skipped entirely. Here's the documentation 
>> from https://jpsoft.com/help/call.htm which give a better explanation of 
>> this eye bleeding nightmare:
>>
>> WARNING! If you execute a batch file from inside another batch file 
>> without using CALL, the original batch file is terminated before the other 
>> one starts. This method of invoking a batch file from another is usually 
>> referred to as chaining. Note that if the batch file A.BTM uses CALL B, 
>> and B.BTM chains to the batch file C.BTM, on exit from C.BTM (without 
>> executing a CANCEL <https://jpsoft.com/help/cancel.htm> command) 
>> processing of batch file A.BTM is resumed as if it had used CALL C.
>>
>
> But I am using CALL to run the other batch file. The problem is when I run 
> the build, it is completed successfully. But the server is still not 
> started. The commands works great in CMD and also I tried creating a batch 
> file and even it works fine. And again I tried calling the batch file I 
> created into Jenkins, yet there was no success. The problem still remained 
> and the server was still not started.
>
>>
>>
>> I suspect that the Jenkins shell execute the script you gave it as it is 
>> a call itself maybe, maybe the Jenkins people can shed some light on this.
>>
>
>
> Regards,
> Harvey
>

By using the following link: 
https://wiki.jenkins.io/display/JENKINS/ProcessTreeKiller, I edited the 
command as follows:

cd c:\glassfish3\bin\
asadmin start-domain
$BUILD_ID=dontKillMe 

But it didn't solve my problem though. I am sure that this is not the way. 
I am new user to Jenkins, I have no idea about using environment variables. 
Any help would be appreciated, I am blocked at this stage, would be 
grateful if anyone could guide me in this regard.

Regards,
Harvey

-- 
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/a3b7ef0b-1fbb-4bbc-b8a6-1cda2df84f1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running a bat file

2017-09-13 Thread harvey


On Tuesday, September 12, 2017 at 7:21:55 PM UTC+2, jer...@bodycad.com 
wrote:
>
> Take care that you are actually chaining batch command. What is chaining 
> batch, someone somewhere though it would be nice to make this super weird 
> feature for batch script only (yeah a lot of sarcasm here, the first time 
> you see this beahavior and realize wtf someone wanted to do this is beyond 
> total common sense), where you call a batch from another batch script, the 
> remaining in between one can be skipped entirely. Here's the documentation 
> from https://jpsoft.com/help/call.htm which give a better explanation of 
> this eye bleeding nightmare:
>
> WARNING! If you execute a batch file from inside another batch file 
> without using CALL, the original batch file is terminated before the other 
> one starts. This method of invoking a batch file from another is usually 
> referred to as chaining. Note that if the batch file A.BTM uses CALL B, 
> and B.BTM chains to the batch file C.BTM, on exit from C.BTM (without 
> executing a CANCEL <https://jpsoft.com/help/cancel.htm> command) 
> processing of batch file A.BTM is resumed as if it had used CALL C.
>

But I am using CALL to run the other batch file. The problem is when I run 
the build, it is completed successfully. But the server is still not 
started. The commands works great in CMD and also I tried creating a batch 
file and even it works fine. And again I tried calling the batch file I 
created into Jenkins, yet there was no success. The problem still remained 
and the server was still not started.

>
>
> I suspect that the Jenkins shell execute the script you gave it as it is a 
> call itself maybe, maybe the Jenkins people can shed some light on this.
>


Regards,
Harvey

-- 
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/2a2020e0-eea1-433c-8363-89b6467a135d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Running a bat file

2017-09-12 Thread harvey
Hi,

I am trying to run a bat file to start a server and I used the following 
script:

cd c:\...\bin
call asadmin start-domain

But I see that Jenkins isn't waiting for the batch script to exhibit.

I would be thankful, if you could guide me in this regard.

Regards,
Harvey

-- 
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/27491f4b-13df-4afb-a3f5-878acf1cef93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to automate ENTER key action

2017-09-07 Thread harvey
Hi

How to automate the ENTER key action?

Actually I have a batch file to initialize a database, and it demands for a 
manual pressing of ENTER key to proceed with the process. Is there any way 
to automate the ENTER key action in Jenkins?

Any help would be appreciated. Kindly guide me in this regard. 

Regards,

Harvey

-- 
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/974a9f8f-a04e-4900-9e0e-74cf53dff51a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple commands

2017-09-05 Thread harvey
I am sorry but neither removing helped me solve the problem. I follow the 
following steps in CMD normally,

cd "C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin\ 
mysql -u root -p 
*
CREATE DATABASE xyz;

It works great when done manually but not with Jenkins. In jenkins it is 
not taking the password , the build is  running continuously. Any guidance 
is appreciated.

Regards,
Harvey



On Monday, September 4, 2017 at 4:13:05 PM UTC+2, Daniel Butler wrote:
>
> Remove the starting and finishing triple quote marks (they’re only needed 
> in a pipeline script)
>
>  
>
> Note you’ll need to provide the username and password as part of the 
> command line to MySQL; you’re best to use the Credentials Binding plugin 
> and use a ‘Username and Password (Separated)’ binding. Then you can refer 
> to them in the batch script as regular environment variables.
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *harvey 
> *Sent: *04 September 2017 14:01
> *To: *Jenkins Users 
> *Subject: *Re: Multiple commands
>
>  
>
> Hi Daniel,
>
> Thank you for your reply. I am using a freestyle job and unfortunately the 
> script didnot work in my case:
>
> I choosed execute windows batch command and typed the following:
>
> """ cd c:\
> \mysql --username --password -e "DROP DATABASE xyz; CREATE DATABASE 
> xyz;"
> """
> Is there something which am missing ?
>
> Regards,
> Harvey
>
> On Monday, September 4, 2017 at 1:43:29 PM UTC+2, Daniel Butler wrote:
>
>  
>
> Are you using freestyle jobs or pipeline?
>
> With Pipeline:
>
>
> When you use a bat/sh step you’re providing a batch or shell script rather 
> than virtual input into a console.
>
>  
>
> In your case you’d need to do something like:
> bat """
>
> cd c:\...
>
> ...\mysql --user %user% --password %password% -e "DROP DATABASE xyz; 
> CREATE DATABASE xyz;"
>
> """
>
>  
>
> Freestyle you’d use the same text between the triple quotes in a Batch 
> step.
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *harvey
> *Sent: *04 September 2017 12:04
> *To: *Jenkins Users
> *Subject: *Multiple commands
>
>  
>
> Hi,
>
> I am a new user to Jenkins. I just started working with Jenkins. I am 
> learning to automate using Jenkins. But I dont find like how to pass two 
> commands? For example, if I need to run a database creation using MySQL I 
> should do the following:
>
> cd c:\...\MySQL 5.5 server\bin\mysql.exe
> password: 
> drop database xyz;
> create database xyz;
>
> Actually there is a wait between the execution of the commands, so how do 
> i do it? Please if someone could help ?
>
> Regards,
> Harvey
>
> -- 
> 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-use...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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-use...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/040e2219-39ea-4490-b290-1b559eabb935%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/040e2219-39ea-4490-b290-1b559eabb935%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/0742247a-9147-4ba1-b488-7c02896cc39e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple commands

2017-09-04 Thread harvey
Hi Daniel,

Thank you for your reply. I am using a freestyle job and unfortunately the 
script didnot work in my case:

I choosed execute windows batch command and typed the following:

""" cd c:\
\mysql --username --password -e "DROP DATABASE xyz; CREATE DATABASE 
xyz;"
"""
Is there something which am missing ?

Regards,
Harvey

On Monday, September 4, 2017 at 1:43:29 PM UTC+2, Daniel Butler wrote:
>
>  
>
> Are you using freestyle jobs or pipeline?
>
> With Pipeline:
>
>
> When you use a bat/sh step you’re providing a batch or shell script rather 
> than virtual input into a console.
>
>  
>
> In your case you’d need to do something like:
> bat """
>
> cd c:\...
>
> ...\mysql --user %user% --password %password% -e "DROP DATABASE xyz; 
> CREATE DATABASE xyz;"
>
> """
>
>  
>
> Freestyle you’d use the same text between the triple quotes in a Batch 
> step.
>
>  
>
> Regards,
>
> Daniel.
>
>  
>
> *From: *harvey 
> *Sent: *04 September 2017 12:04
> *To: *Jenkins Users 
> *Subject: *Multiple commands
>
>  
>
> Hi,
>
> I am a new user to Jenkins. I just started working with Jenkins. I am 
> learning to automate using Jenkins. But I dont find like how to pass two 
> commands? For example, if I need to run a database creation using MySQL I 
> should do the following:
>
> cd c:\...\MySQL 5.5 server\bin\mysql.exe
> password: 
> drop database xyz;
> create database xyz;
>
> Actually there is a wait between the execution of the commands, so how do 
> i do it? Please if someone could help ?
>
> Regards,
> Harvey
>
> -- 
> 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-use...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jenkinsci-users/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/040e2219-39ea-4490-b290-1b559eabb935%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Multiple commands

2017-09-04 Thread harvey
Hi,

I am a new user to Jenkins. I just started working with Jenkins. I am 
learning to automate using Jenkins. But I dont find like how to pass two 
commands? For example, if I need to run a database creation using MySQL I 
should do the following:

cd c:\...\MySQL 5.5 server\bin\mysql.exe
password: 
drop database xyz;
create database xyz;

Actually there is a wait between the execution of the commands, so how do i 
do it? Please if someone could help ?

Regards,
Harvey

-- 
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/02c8c0a5-190d-4c65-b1b5-bf29ad352759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Security bug

2016-06-16 Thread Edward Ned Harvey (jenkins)
Where should I report security bugs?

-- 
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/BY1PR0401MB1255564BFF1C1AF0ACF78913DC560%40BY1PR0401MB1255.namprd04.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.