jenkins-plugins

Jenkins execute PowerShell scripts

丶灬走出姿态 提交于 2020-01-14 10:33:11
问题 I'm trying to run PowerShell scripts from Jenkins, but it seems to completely ignore the execution policy! This happens either by executing powershell.exe directly, or using the PowerShell plugin Additional information: Jenkins is running as a Windows Service (using the Local System account, non-interactive). Connecting to that server, and checking execution policy is indeed RemoteSigned : PS C:\> whoami nt authority\system PS C:\> Get-ExecutionPolicy RemoteSigned PS C:\> However, when

Jenkins execute PowerShell scripts

人盡茶涼 提交于 2020-01-14 10:32:28
问题 I'm trying to run PowerShell scripts from Jenkins, but it seems to completely ignore the execution policy! This happens either by executing powershell.exe directly, or using the PowerShell plugin Additional information: Jenkins is running as a Windows Service (using the Local System account, non-interactive). Connecting to that server, and checking execution policy is indeed RemoteSigned : PS C:\> whoami nt authority\system PS C:\> Get-ExecutionPolicy RemoteSigned PS C:\> However, when

Jenkins Pipeline having “Multiple candidate revisions” and is picking old one

走远了吗. 提交于 2020-01-14 07:47:33
问题 i have a Jenkins multibranch Pipeline configured which should fetch sources from a remote GIT repository for a build. Jenkins no seems to "randomly" pick an old commit for the build an showing the message "Multiple candidate revisions" in Build log files. My Pipeline is looking like: checkout( [ $class: 'GitSCM', branches: [[name: "release/0.0.1"]], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'MessageExclusion', excludedMessage: '(?s)^\\[DOC\\] Robot.*'] ], submoduleCfg:

Where body is put in post with http request plugin in jenkins

我是研究僧i 提交于 2020-01-14 05:23:11
问题 This might be the silliest question, but definitely it is not obvious. I am trying to send a POST request in Jenkins, using the HTTP Request Plugin. However I cannot find a field to put the body message/content, that I want to post. Any ideas? This is a screenshot of the available options 回答1: Right now there is no support to send body content. There is a pull request under approval and it might be merged soon. https://github.com/jenkinsci/http-request-plugin/pull/14 回答2: You can submit the

Jenkins Packages on Groovy Classpath?

做~自己de王妃 提交于 2020-01-13 10:23:12
问题 When using the Groovy Jenkins plugin (not the Groovy Post Build Plugin, which is a different thing) as a Post Step, I can't resolve classes in the hudson.model package. Do I need to add the Jenkins .war onto the classpath, or should these packages already be there? Script: import hudson.model.*; import hudson.util.*; AbstractBuild currentBuild = (AbstractBuild) Thread.currentThread().executable; def mavenVer = currentBuild.getMavenArtifacts().getModuleRecords()[0].mainArtifact.version;

Jenkins Workflow Multibranch allow for specifying Jenkinsfile path

≯℡__Kan透↙ 提交于 2020-01-13 08:21:09
问题 It seems like now you can only have a single Jenkinsfile in a single location in your project when using Multibranch type. Is there a way to configure so I can place the Jenkinsfile somewhere else than in the root of the project under the name Jenkinsfile. There's hope, as there's an option of Fixed Configuration, maybe this is a feature for the future, but I would much appreciate the option, as in the current situation I do not have the option to run everything as one nicely compiled

Jenkins checkout of GIT project fails with Permission denied fatal: unable to fork

荒凉一梦 提交于 2020-01-13 05:23:04
问题 I have a Freestyle Jenkins project that uses bitbucket as SCM with ssh as protocol and private key (not user/password). When I build the project on master it fails with below stacktrace, while it runs fine on agent. Notice error mentions: stderr: fatal: cannot exec '/var/lib/jenkins/workspace/foo_test@tmp/ssh1377177620135545595.sh': Permission denied fatal: unable to fork I checked the following: Running this as jenkins user from command line shows no problem. The folder /var/lib/jenkins

How to throw exception in jenkins pipeline?

允我心安 提交于 2020-01-12 12:09:20
问题 I have handled the Jenkins pipeline steps with try catch blocks. I want to throw an exception manually for some cases. but it shows the below error. org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.io.IOException java.lang.String I checked the scriptApproval section and there is no pending approvals. 回答1: If you want to abort your program on exception, you can use pipeline step error to stop the pipeline execution with an error.

How to throw exception in jenkins pipeline?

烈酒焚心 提交于 2020-01-12 12:04:30
问题 I have handled the Jenkins pipeline steps with try catch blocks. I want to throw an exception manually for some cases. but it shows the below error. org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.io.IOException java.lang.String I checked the scriptApproval section and there is no pending approvals. 回答1: If you want to abort your program on exception, you can use pipeline step error to stop the pipeline execution with an error.

How to throw exception in jenkins pipeline?

你说的曾经没有我的故事 提交于 2020-01-12 12:02:16
问题 I have handled the Jenkins pipeline steps with try catch blocks. I want to throw an exception manually for some cases. but it shows the below error. org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use new java.io.IOException java.lang.String I checked the scriptApproval section and there is no pending approvals. 回答1: If you want to abort your program on exception, you can use pipeline step error to stop the pipeline execution with an error.