Changing parameter names to not interfere with Jenkins Defaults.

This commit is contained in:
Daniel Brooks 2014-07-01 11:48:51 -07:00
parent 18194cbbaa
commit adb2c6dca8
6 changed files with 25 additions and 14 deletions

10
CHANGELOG.md Normal file
View File

@ -0,0 +1,10 @@
ChangeLog
=====================
1.0.1
=====================
* Changed Parameter names that were used by default by jenkins.
1.0
=====================
* Initial Release

View File

@ -28,10 +28,10 @@ Using it With A Job
* Feel free to specify the ``GitHub Project`` url as the url for the Gitlab project (if you have the GitHub plugin installed)
* In the ``Source Code Management`` section:
* Click ``Git`` and enter your Repositroy URL and in Advanced set its Name to ``origin``
* In ``Branch Specifier`` enter ``origin/${sourceBranch}``
* In ``Branch Specifier`` enter ``origin/${gitlabSourceBranch}``
* In the ``Additional Behaviours`` section:
* Click the ``Add`` drop down button and the ``Merge before build`` item
* Specify the name of the repository as ``origin`` (if origin corresponds to Gitlab) and enter the ``Branch to merge to`` as ``${targetBranch}``
* Specify the name of the repository as ``origin`` (if origin corresponds to Gitlab) and enter the ``Branch to merge to`` as ``${gitlabTargetBranch}``
* In the ``Build Triggers`` section:
* Check the ``Build when a change is pushed to GitLab.``
* In GitLab go to the project ``Settings``
@ -47,9 +47,9 @@ Using it With A Job
You can trigger a job a manually by clicking ``This build is parameterized`` and adding the relevant build parameters.
These include:
* sourceBranch
* targetBranch
* branch (This is optional and can be used in shell scripts for the branch being built by the push request)
* gitlabSourceBranch
* gitlabTargetBranch
* gitlabBranch (This is optional and can be used in shell scripts for the branch being built by the push request)
Help Needed

View File

@ -12,9 +12,9 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
<output url="file://$MAVEN_REPOSITORY$/org/jenkins-ci/plugins/plugin/1.564/target/classes" />
<output-test url="file://$MAVEN_REPOSITORY$/org/jenkins-ci/plugins/plugin/1.564/target/test-classes" />
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/target/generated-sources/localizer" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
@ -26,6 +26,7 @@
<excludeFolder url="file://$MODULE_DIR$/target/jenkins-for-test" />
<excludeFolder url="file://$MODULE_DIR$/target/surefire-reports" />
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
<excludeFolder url="file://$MODULE_DIR$/target/work" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@ -8,7 +8,7 @@
<groupId>com.dabsquared</groupId>
<artifactId>gitlab-jenkins</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.1-SNAPSHOT</version>
<packaging>hpi</packaging>
<name>GitLab Plugin</name>
<url>http://wiki.jenkins-ci.org/display/JENKINS/Gitlab+Plugin</url>

View File

@ -92,9 +92,9 @@ public class GitLabPushTrigger extends Trigger<AbstractProject<?, ?>> {
String randomBranchName = spec.getName();
Map<String, ParameterValue> values = new HashMap<String, ParameterValue>();
values.put("sourceBranch", new StringParameterValue("sourceBranch", randomBranchName));
values.put("targetBranch", new StringParameterValue("targetBranch", randomBranchName));
values.put("branch", new StringParameterValue("branch", branch));
values.put("gitlabSourceBranch", new StringParameterValue("gitlabSourceBranch", randomBranchName));
values.put("gitlabTargetBranch", new StringParameterValue("gitlabTargetBranch", randomBranchName));
values.put("gitlabBranch", new StringParameterValue("gitlabBranch", branch));
List<ParameterValue> listValues = new ArrayList<ParameterValue>(values.values());
@ -141,8 +141,8 @@ public class GitLabPushTrigger extends Trigger<AbstractProject<?, ?>> {
List<Action> actions = new ArrayList<Action>();
Map<String, ParameterValue> values = new HashMap<String, ParameterValue>();
values.put("sourceBranch", new StringParameterValue("sourceBranch", String.valueOf(req.getObjectAttribute().getSourceBranch())));
values.put("targetBranch", new StringParameterValue("targetBranch", String.valueOf(req.getObjectAttribute().getTargetBranch())));
values.put("gitlabSourceBranch", new StringParameterValue("gitlabSourceBranch", String.valueOf(req.getObjectAttribute().getSourceBranch())));
values.put("gitlabTargetBranch", new StringParameterValue("gitlabTargetBranch", String.valueOf(req.getObjectAttribute().getTargetBranch())));
List<ParameterValue> listValues = new ArrayList<ParameterValue>(values.values());