jenkins-plugins

How to POST JSON data in body with Jenkins http-request plugin and Pipeline?

ε祈祈猫儿з 提交于 2019-12-08 15:43:13
问题 With v1.8.10 of the http-request plugin for Jenkins (I'm running 1.643), there is now support for POSTing a body in the request -- so this thread does not apply. I am wondering how to use this functionality in a Pipeline (v2.1) Groovy script? The Snippet Generator does not include this new field, so I have no example to build off of. I have tried various ways to get the JSON data into the request body, but my Tomcat server always returns http 400 status code: The request sent by the client

Git plugin for Jenkins: How do I set env variables GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL?

感情迁移 提交于 2019-12-08 15:29:33
问题 I have been trying to set the environment variables GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL so that the GIT plugin for Jenkins claims to be setting(https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin). I see that the rest of the environment variables viz. GIT_URL , GIT_BRANCH , GIT_COMMIT , GIT_PREVIOUS_COMMIT are set accurately for each of the jenkins jobs. I am testing this by printing out all the environment variables in a jenkins jobs shell script build step by using printenv . Can

Executing Batch File in Jenkins

点点圈 提交于 2019-12-08 15:29:01
问题 I have a simple batch file. I want to call/run/execute that file from Jenkins . Is there are plugin in Jenkins for the same ? How can execute the batch file from Jenkins ? If there is any tutorial or documentation for the same. 回答1: On Linux, go to your jenkins job, go to configuration, add build step "execute shell", then type the name of your script. Please be sure that your file is executable (chmod 777 yourscript.sh) and in the right place (checkout via GIT or SVN, please check your job

hudson*.groovy not found in jenkins

≡放荡痞女 提交于 2019-12-08 15:13:01
问题 I am trying to configure jenkins job with groovy scripts, I donot know what I am doing wrong with the configuration that I could not execute even a simple groovy command like println System.getenv("PATH") it shows the following stack trace when the jenkins tries to build then following error is thrown [workspace] $ groovy "C:\Program Files (x86)\Jenkins\jobs\{Project_Name}\workspace\hudson2392295018240496017.groovy" The system cannot find the file specified FATAL: command execution failed

Shallow fetch and shallow clone

梦想的初衷 提交于 2019-12-08 13:44:38
问题 So, Git plugin in Jenkins offers an option to do Shallow clone. But not shallow fetch. Is that possible ? 回答1: Check the log of a job configured with a shallow clone: if the workspace is already cloned (shallow), the subsequent execution of that same job would perform a shallow fetch anyway. Even a simple git fetch would not fetch past the limit imposed by the original shallow clone. (unless you are using explicitly --depth= , or --deepen= , or --unshallow ). That would explain why Jenkins

Jenkins Groovy Remove user access from Project Matrix Authorization Strategy

戏子无情 提交于 2019-12-08 11:35:32
问题 We are using Project-Based Matrix Authorization Strategy and users are given access under Manage Jenkins -> Configure Global Security -> Authorization -> Users are provided appropriate accesses. We are providing user accesses at the folder level as well. Using below code I am able to remove user access, def amp = folder.getProperties().get(AuthorizationMatrixProperty.class) def op = amp.grantedPermissions // Code to remove permissions for user from Set This works fine. But for manage jenkins

Regex - Jenkins check empty variable

空扰寡人 提交于 2019-12-08 10:32:38
问题 I use a plugin with Jenkins to execute a job with a condition step . I want to check if the parameter that I use is empty with this regular expression : ^$ And the label field : ${ENV,var="date.test"} If the parameter is empty the job continue, but if has value it stop. But that does the opposite that I want. 回答1: I've tried Regular Expression: ${ENV,var="date.test"} with an empty label and it works. 来源: https://stackoverflow.com/questions/31424679/regex-jenkins-check-empty-variable

Parameterize the approver detail in Promoted Build Plugin in Jenkins

和自甴很熟 提交于 2019-12-08 09:36:57
问题 I am using Promote Build plugin in Jenkins . I need to take the approver information from the user in Jenkins and provide him the approval rights . Here is what I am trying to do : Is it feasible ? 回答1: Don't think you can use variables there. However, you could skip that condition, and instead have an Execute Shell build step, and there check for variables $PROMOTED_USER_NAME . Parse the name, and make your decision based on that. Parent parameters don't automatically get passed to Promoted

How to call a build flow from a build flow passing different parameters?

大兔子大兔子 提交于 2019-12-08 08:50:29
I have 3 Jobs (let's name it as job1,job2,job3) which all accepts same parameters. I have a build flow calling these jobs Eg Build Flow:: build(job1, param1 : "value1", param2 : "value2" ) build(job2, param1 : "value1", param2 : "value2" ) build(job3, param1 : "value1", param2 : "value2" ) As you see in the example all the jobs accept same parameters. And I want to run the same sequence in the build flow (job1, job2, job3) with different parameter values. So Now I am having different build flows to pass different values to the parameter: eg: Build flow1--- build(job1, param1 : "value1", param2

Jenkins : poll-mailbox-trigger-plugin and SMTP

时光毁灭记忆、已成空白 提交于 2019-12-08 07:00:12
问题 I am unable to get Jenkins to build based on an email using the poll-mailbox-trigger plugin My setup in E-mail Notification is as follows SMTP server: myExchangeServerHostName Default user e-mail suffix: @companyName.com Use SMTP Authentication: True User Name: DOMAIN\user Password: aboveUserPassword Use SSL: False SMTP Port: 587 Reply-To Address: Charset: UTF-8 From here I can successfully send a test email to myself and I receive it. In my build the Poll Mailbox Trigger settings are as