-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Job will be created with Sauce Labs enabled as well as Sauce Labs Test Publisher. This uses the Java-JUnit-Selenium repo.
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import hudson.model.FreeStyleProject; | ||
import hudson.plugins.git.GitSCM; | ||
import hudson.plugins.git.BranchSpec; | ||
import hudson.plugins.sauce_ondemand.SauceOnDemandBuildWrapper; | ||
import hudson.plugins.sauce_ondemand.SauceOnDemandTestPublisher | ||
import hudson.plugins.sauce_ondemand.SeleniumInformation; | ||
import hudson.tasks.Maven; | ||
import jenkins.model.Jenkins | ||
|
||
|
||
jenkins = Jenkins.instance; | ||
|
||
// Create free project in the main Jenkins instance. | ||
FreeStyleProject freeProject = new FreeStyleProject(jenkins,"sample-java-freestyle"); | ||
|
||
// Create Git SCM option and set to master branch | ||
scm2 = new GitSCM("https://github.com/saucelabs-sample-test-frameworks/Java-JUnit-Selenium"); | ||
scm2.branches = [new BranchSpec("*/master")]; | ||
|
||
// Create Maven Builder | ||
Maven maven = new Maven("clean test",null); | ||
|
||
// Create "Sauce Labs Support" instance | ||
// This is only setting credentials to the ID created on createSauceCredentials.groovy | ||
SauceOnDemandBuildWrapper sauceWrapper = new SauceOnDemandBuildWrapper(false,null, "saucelabs",new SeleniumInformation(null, null),null,null,"",null,false,false,false,false,false,null,null,null,false); | ||
|
||
SauceOnDemandTestPublisher testPublisher = new SauceOnDemandTestPublisher(); | ||
|
||
// add Maven Builder | ||
freeProject.buildersList.add(maven); | ||
|
||
// add Git repo | ||
freeProject.scm = scm2 | ||
|
||
// Add Sauce Support usage | ||
freeProject.getBuildWrappersList().add(sauceWrapper); | ||
|
||
// Add Sauce test publisher | ||
freeProject.getPublishersList().add(testPublisher); | ||
|
||
// Add project and settings to instance | ||
jenkins.add(freeProject, freeProject.name); |