How do you load a groovy file and execute it

If your Jenkinsfile and groovy file in one repository and Jenkinsfile is loaded from SCM you have to do: Example.Groovy def exampleMethod() { //do something } def otherExampleMethod() { //do something else } return this JenkinsFile node { def rootDir = pwd() def exampleModule = load “${rootDir}@script/Example.Groovy ” exampleModule.exampleMethod() exampleModule.otherExampleMethod() }

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

How do I schedule jobs in Jenkins?

By setting the schedule period to 15 13 * * * you tell Jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day. Jenkins used a cron expression, and the different fields are: MINUTES Minutes in one hour (0-59) HOURS Hours … Read more