-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from jenkinsci/build_with_parameters
Add the ability to build with parameters
- Loading branch information
Showing
7 changed files
with
158 additions
and
59 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
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
33 changes: 33 additions & 0 deletions
33
src/main/java/hudson/plugins/tfs/model/BuildWithParametersCommand.java
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,33 @@ | ||
package hudson.plugins.tfs.model; | ||
|
||
import hudson.plugins.tfs.util.MediaType; | ||
import org.apache.commons.io.IOUtils; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
|
||
public class BuildWithParametersCommand extends BuildCommand { | ||
|
||
public static class Factory implements AbstractCommand.Factory { | ||
|
||
@Override | ||
public AbstractCommand create() { | ||
return new BuildWithParametersCommand(); | ||
} | ||
|
||
@Override | ||
public String getSampleRequestPayload() { | ||
final Class<? extends Factory> me = this.getClass(); | ||
final InputStream stream = me.getResourceAsStream("BuildWithParametersCommand.json"); | ||
try { | ||
return IOUtils.toString(stream, MediaType.UTF_8); | ||
} | ||
catch (final IOException e) { | ||
throw new Error(e); | ||
} | ||
finally { | ||
IOUtils.closeQuietly(stream); | ||
} | ||
} | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/resources/hudson/plugins/tfs/model/BuildCommand.json
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,11 @@ | ||
{ | ||
"team-parameters": | ||
{ | ||
"collectionUri":"https://fabrikam-fiber-inc.visualstudio.com", | ||
"repoUri":"https://fabrikam-fiber-inc.visualstudio.com/Personal/_git/olivida.tfs-plugin", | ||
"projectId":"Personal", | ||
"repoId":"olivida.tfs-plugin", | ||
"commit":"6a23fc7afec31f0a14bade6544bed4f16492e6d2", | ||
"pushedBy":"olivida" | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/resources/hudson/plugins/tfs/model/BuildWithParametersCommand.json
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,16 @@ | ||
{ | ||
"parameter": | ||
[ | ||
{"name":"id","value":"123"}, | ||
{"name":"verbosity","value":"high"} | ||
], | ||
"team-parameters": | ||
{ | ||
"collectionUri":"https://fabrikam-fiber-inc.visualstudio.com", | ||
"repoUri":"https://fabrikam-fiber-inc.visualstudio.com/Personal/_git/olivida.tfs-plugin", | ||
"projectId":"Personal", | ||
"repoId":"olivida.tfs-plugin", | ||
"commit":"6a23fc7afec31f0a14bade6544bed4f16492e6d2", | ||
"pushedBy":"olivida" | ||
} | ||
} |