Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-38978] Reproduce param passing problem in matrix projects
The reproduction of the parameters not being passed to child jobs in
multi-configuration projects requires:
* adding a new _test-matrix_ job for the dev environment
* upgrading to Jenkins 1.609
* adding the _matrix-project_ plugin (in test scope) with version 1.7
* upgrading the credentials plugin to 1.14

The freestyle test job for the development workspace was renamed and
improved, too.
  • Loading branch information
marcrohlfs committed Jan 4, 2018
1 parent cc341d1 commit b7609bb
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 12 deletions.
10 changes: 8 additions & 2 deletions pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.481</version>
<version>1.609</version>
</parent>

<prerequisites>
Expand Down Expand Up @@ -72,14 +72,20 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.9.1</version>
<version>1.14</version>
</dependency>
<dependency>
<groupId>com.sonyericsson.hudson.plugins.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>1.25</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<version>1.7</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Expand Up @@ -18,7 +18,7 @@
<versionFilter></versionFilter>
<sortOrder>DESC</sortOrder>
<maxVersions></maxVersions>
<currentArtifactInfoUrl>file://${project.basedir}/work/jobs/testjob/currentArtifactInfo.txt</currentArtifactInfoUrl>
<currentArtifactInfoUrl>file://${project.basedir}/work/jobs/test-freestyle/currentArtifactInfo.txt</currentArtifactInfoUrl>
<currentArtifactInfoLabel>Currently under development</currentArtifactInfoLabel>
<currentArtifactInfoPattern>Plugin Version: ([\S]+)</currentArtifactInfoPattern>
<credentialsId></credentialsId>
Expand All @@ -31,18 +31,11 @@
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers class="vector"/>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.tasks.Shell>
<command>echo &quot;Selected artifact:&quot;
echo &quot; Group ID: ${ARTIFACT_GROUP_ID}&quot;
echo &quot; Artifact ID: ${ARTIFACT_ARTIFACT_ID}&quot;
echo &quot; Version: ${ARTIFACT_VERSION}&quot;
echo &quot; Type: ${ARTIFACT_PACKAGING}&quot;
echo &quot; Classifier: ${ARTIFACT_CLASSIFIER}&quot;
echo &quot; Download URL: ${ARTIFACT_ARTIFACT_URL}&quot;
</command>
<command>env | grep &quot;^ARTIFACT_&quot; | sort</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
Expand Down
62 changes: 62 additions & 0 deletions src/dev/assets/work/jobs/test-matrix/config.xml
@@ -0,0 +1,62 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterDefinition>
<name>ARTIFACT</name>
<description></description>
<repoBaseUrl>http://repo.jenkins-ci.org/public</repoBaseUrl>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<packaging>${project.packaging}</packaging>
<defaultValue></defaultValue>
<classifier></classifier>
<versionFilter></versionFilter>
<sortOrder>DESC</sortOrder>
<maxVersions></maxVersions>
<currentArtifactInfoUrl>file://${project.basedir}/work/jobs/test-matrix/currentArtifactInfo.txt</currentArtifactInfoUrl>
<currentArtifactInfoLabel>Currently under development</currentArtifactInfoLabel>
<currentArtifactInfoPattern>Plugin Version: ([\S]+)</currentArtifactInfoPattern>
<credentialsId></credentialsId>
</eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<axes>
<hudson.matrix.TextAxis>
<name>ARTIFACT_AXIS_A</name>
<values>
<string>1</string>
<string>2</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>ARTIFACT_AXIS_B</name>
<values>
<string>3</string>
<string>4</string>
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>env | grep &quot;^ARTIFACT_&quot; | sort</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>false</runSequentially>
</executionStrategy>
</matrix-project>
3 changes: 3 additions & 0 deletions src/dev/assets/work/jobs/test-matrix/currentArtifactInfo.txt
@@ -0,0 +1,3 @@
Plugin ID: ${project.artifactId}
Plugin Version: ${project.version}
Jenkins Core Version: ${project.parent.version}

0 comments on commit b7609bb

Please sign in to comment.