Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support an inline box to specify dsl scripts, close #21
- Loading branch information
Justin Ryan
committed
May 22, 2012
1 parent
37b9352
commit cfd2dad
Showing
10 changed files
with
178 additions
and
37 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
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
Binary file not shown.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Thu Apr 12 10:05:08 PDT 2012 | ||
#Wed May 16 10:59:17 PDT 2012 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-1-bin.zip | ||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-rc-3-bin.zip |
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
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
16 changes: 11 additions & 5 deletions
16
src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/config.groovy
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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
package javaposse.jobdsl.plugin.ExecuteDslScripts; | ||
|
||
import lib.LayoutTagLib | ||
def f=namespace(lib.FormTagLib) | ||
|
||
f=namespace(lib.FormTagLib) | ||
|
||
f.entry(title:_("DSL Scripts"),field:"targets") { | ||
f.expandableTextbox() | ||
f.radioBlock(name: 'scriptLocation', value: 'true', title: 'Use the provided DSL script', checked: instance.usingScriptText) { | ||
f.entry(title: 'DSL Script', field: 'scriptText') { | ||
// TODO CodeMirror support for text/x-groovy. It was unclear how do it from a .groovy stapler script | ||
f.textarea(style: 'width:100%; height:10em') | ||
} | ||
} | ||
f.radioBlock(name: 'scriptLocation', value: 'false', title: 'Look on Filesystem', checked: !instance.usingScriptText) { | ||
f.entry(title: 'DSL Scripts', field: 'targets') { | ||
f.expandableTextbox() | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/help-scriptText.html
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,3 @@ | ||
<div> | ||
Job DSL Script, which is groovy code. Look at <a href="https://github.com/JavaPosseRoundup/job-dsl-plugin">documentation</a> for details on the syntax. | ||
</div> |
2 changes: 1 addition & 1 deletion
2
src/main/resources/javaposse/jobdsl/plugin/ExecuteDslScripts/help-targets.html
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div> | ||
Newline separated list of DSL scripts. | ||
Newline separated list of DSL scripts, located in the Workspace. | ||
</div> |
46 changes: 46 additions & 0 deletions
46
src/test/groovy/javaposse/jobdsl/plugin/SeedJobTest.groovy
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,46 @@ | ||
package javaposse.jobdsl.plugin; | ||
|
||
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.apache.commons.io.FileUtils; | ||
import hudson.model.*; | ||
import hudson.tasks.Shell; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
|
||
public class SeedJobTest { // extends HudsonTestCase { | ||
@Rule | ||
public JenkinsRule j = new JenkinsRule(); | ||
|
||
private static final String templateProjectName = "TMPL"; | ||
|
||
@Test | ||
public void createTemplateTest() throws Exception { | ||
// java.lang.NoClassDefFoundError: hudson/tasks/Ant$AntInstallation | ||
// FreeStyleProject project = j.createFreeStyleProject() | ||
// project.getBuildersList().add(new Shell("echo hello")) | ||
// project.setDisplayName(templateProjectName) | ||
} | ||
|
||
// @Test | ||
// public void createSeedJob() throws Exception { | ||
// String templateProjectName = createTemplateTest(); | ||
// | ||
// String dsl = ''' | ||
//job { | ||
// using 'TMPL' | ||
// name 'unit-test' | ||
//} | ||
//''' | ||
// FreeStyleProject project = j.createFreeStyleProject(); | ||
// project.getBuildersList().add(new ExecuteDslScripts(dsl)); | ||
// | ||
// FreeStyleBuild build = project.scheduleBuild2(0).get(); | ||
// System.out.println(build.getDisplayName()+" completed"); | ||
// | ||
// String s = FileUtils.readFileToString(build.getLogFile()); | ||
// assertThat(s, contains("+ echo hello")); | ||
// | ||
// // TODO Check for new "unit-test" job | ||
// Project createdProj = (Project) j.jenkins.getItem('unit-test') | ||
// } | ||
} |