Jenkins Pipeline Wipe Out Workspace

Like @gotgenes pointed out with Jenkins Version. 2.74, the below works, not sure since when, maybe if some one can edit and add the version above cleanWs() With, Jenkins Version 2.16 and the Workspace Cleanup Plugin, that I have, I use step([$class: ‘WsCleanup’]) to delete the workspace. You can view it by going to JENKINS_URL/job/<any … Read more

Jenkins pipeline: agent vs node?

The simple answer is, Agent is for declarative pipelines and node is for scripted pipelines. In declarative pipelines the agent directive is used for specifying which agent/slave the job/task is to be executed on. This directive only allows you to specify where the task is to be executed, which agent, slave, label or docker image. … Read more

Jenkins Host key verification failed

Change to the jenkins user and run the command manually: git ls-remote -h git@bitbucket.org:person/projectmarket.git HEAD You will get the standard SSH warning when first connecting to a new host via SSH: The authenticity of host ‘bitbucket.org (207.223.240.181)’ can’t be established. RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40. Are you sure you want to continue connecting (yes/no)? Type … Read more

Skip a submodule during a Maven build

Maven version 3.2.1 added this feature, you can use the -pl switch (shortcut for –projects list) with ! or – (source) to exclude certain submodules. mvn -pl ‘!submodule-to-exclude’ install mvn -pl -submodule-to-exclude install Be careful in bash the character ! is a special character, so you either have to single quote it (like I did) … Read more

How to get a list of installed Jenkins plugins with name and version pair

You can retrieve the information using the Jenkins Script Console which is accessible by visiting http://<jenkins-url>/script. (Given that you are logged in and have the required permissions). Enter the following Groovy script to iterate over the installed plugins and print out the relevant information: Jenkins.instance.pluginManager.plugins.each{ plugin -> println (“${plugin.getDisplayName()} (${plugin.getShortName()}): ${plugin.getVersion()}”) } It will print … Read more

How can I trigger another job from a jenkins pipeline (jenkinsfile) with GitHub Org Plugin?

In addition to the above mentioned answers: I wanted to start a job with a simple parameter passed to a second pipeline and found the answer on http://web.archive.org/web/20160209062101/https://dzone.com/refcardz/continuous-delivery-with-jenkins-workflow So i used: stage (‘Starting ART job’) { build job: ‘RunArtInTest’, parameters: [[$class: ‘StringParameterValue’, name: ‘systemname’, value: systemname]] }

What is the JUnit XML format specification that Hudson supports?

I did a similar thing a few months ago, and it turned out this simple format was enough for Hudson to accept it as a test protocol: <testsuite tests=”3″> <testcase classname=”foo1″ name=”ASuccessfulTest”/> <testcase classname=”foo2″ name=”AnotherSuccessfulTest”/> <testcase classname=”foo3″ name=”AFailingTest”> <failure type=”NotEnoughFoo”> details about failure </failure> </testcase> </testsuite> This question has answers with more details: Spec. for … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)