Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

Commit

Permalink
Fix Git SCM URL
Browse files Browse the repository at this point in the history
  • Loading branch information
fredg02 committed Jan 15, 2018
1 parent 193cab4 commit 370eb1a
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 16 deletions.
29 changes: 13 additions & 16 deletions src/main/resources/xsl/config.job.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -485,22 +485,19 @@
</xsl:choose>
</refspec>
<url>
<xsl:choose>
<xsl:when test="uris/org.eclipse.jgit.transport.URIish [not(scheme)]">
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/path/text()" />
</xsl:when>
<xsl:otherwise>
<!-- TODO: concatenate strings? -->
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/scheme/text()" />
<xsl:text>://</xsl:text>
<xsl:if test="uris/org.eclipse.jgit.transport.URIish/user [text() != '']">
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/user/text()" />
<xsl:text>@</xsl:text>
</xsl:if>
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/host/text()" />
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/path/text()" />
</xsl:otherwise>
</xsl:choose>
<xsl:if test="uris/org.eclipse.jgit.transport.URIish/scheme">
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/scheme/text()" />
<xsl:text>://</xsl:text>
</xsl:if>
<xsl:if test="uris/org.eclipse.jgit.transport.URIish/user [text() != '']">
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/user/text()" />
<xsl:text>@</xsl:text>
</xsl:if>
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/host/text()" />
<xsl:if test="uris/org.eclipse.jgit.transport.URIish/path [substring(text(),1,1) != '/']">
<xsl:text>:</xsl:text>
</xsl:if>
<xsl:value-of select="uris/org.eclipse.jgit.transport.URIish/path/text()" />
</url>
</xsl:element>
</xsl:for-each>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ public void configJobTest_recommenders2() {
transformAndCompare("recommenders2", "config.job.hudson", "matrix-project");
}

/**
* Tests Git SCM URL is transformed correctly
*/
@Test
public void configJobTest_collections() {
transformAndCompareFreestyleJob("collections");
}

@Test
public void copyViewsTest_positive() {
testCopyViews("config.main.jenkins-cbi.xml", "config.main.hudson-cbi.xml");
Expand Down
118 changes: 118 additions & 0 deletions xml/original/config.job.hudson-collections.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<project-properties class="concurrent-hash-map">
<entry>
<string>hudson-plugins-disk_usage-DiskUsageProperty</string>
<base-property>
<originalValue class="hudson.plugins.disk_usage.DiskUsageProperty"/>
<propertyOverridden>false</propertyOverridden>
</base-property>
</entry>
<entry>
<string>builders</string>
<describable-list-property>
<originalValue class="hudson.util.DescribableList">
<hudson.tasks.Shell>
<disabled>false</disabled>
<description>Run gradle build and upload zip/tar files to download site.</description>
<command>export GRADLE_OPTS=&quot;-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -DhttpnonProxyHosts=*.eclipse.org -DhttpsnonProxyHosts=*.eclipse.org -Dftp.proxyHost=proxy.eclipse.org -Dftp.proxyPort=9898 -DftpnonProxyHosts=*.eclipse.org&quot;

./gradlew clean build
cp build/distributions/gsc-ec-converter-*.zip /home/data/httpd/download.eclipse.org/collections/
cp build/distributions/gsc-ec-converter-*.tar /home/data/httpd/download.eclipse.org/collections/
</command>
</hudson.tasks.Shell>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</describable-list-property>
</entry>
<entry>
<string>jdk</string>
<string-property>
<originalValue class="string">jdk1.8.0-latest</originalValue>
<propertyOverridden>false</propertyOverridden>
</string-property>
</entry>
<entry>
<string>scm</string>
<scm-property>
<originalValue class="hudson.plugins.git.GitSCM">
<configVersion>1</configVersion>
<remoteRepositories>
<RemoteConfig>
<name>origin</name>
<uris>
<org.eclipse.jgit.transport.URIish>
<path>eclipse/gsc-ec-converter.git</path>
<rawPath>eclipse/gsc-ec-converter.git</rawPath>
<user>git</user>
<port>-1</port>
<host>github.com</host>
</org.eclipse.jgit.transport.URIish>
</uris>
<pushURIs/>
<fetch>
<org.eclipse.jgit.transport.RefSpec>
<force>true</force>
<wildcard>true</wildcard>
<srcName>refs/heads/*</srcName>
<dstName>refs/remotes/origin/*</dstName>
</org.eclipse.jgit.transport.RefSpec>
</fetch>
<push/>
<uploadpack>git-upload-pack</uploadpack>
<receivepack>git-receive-pack</receivepack>
<tagopt>AUTO_FOLLOW</tagopt>
<mirror>false</mirror>
<timeout>0</timeout>
<relativeTargetDir></relativeTargetDir>
</RemoteConfig>
</remoteRepositories>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<mergeOptions/>
<recursiveSubmodules>false</recursiveSubmodules>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<authorOrCommitter>false</authorOrCommitter>
<clean>false</clean>
<wipeOutWorkspace>false</wipeOutWorkspace>
<pruneBranches>false</pruneBranches>
<remotePoll>false</remotePoll>
<ignoreNotifyCommit>false</ignoreNotifyCommit>
<buildChooser class="hudson.plugins.git.util.DefaultBuildChooser"/>
<gitTool>Default</gitTool>
<submoduleCfg class="list"/>
<includedRegions></includedRegions>
<excludedRegions></excludedRegions>
<excludedUsers></excludedUsers>
<excludedCommits/>
<gitConfigName></gitConfigName>
<gitConfigEmail></gitConfigEmail>
<skipTag>false</skipTag>
<useCgitClone>true</useCgitClone>
</originalValue>
<propertyOverridden>false</propertyOverridden>
</scm-property>
</entry>
</project-properties>
<keepDependencies>false</keepDependencies>
<createdBy>someone@somewhere.com</createdBy>
<creationTime>1458807353072</creationTime>
<properties/>
<cascadingChildrenNames class="java.util.concurrent.CopyOnWriteArraySet"/>
<cascading-job-properties class="java.util.concurrent.CopyOnWriteArraySet">
<string>hudson-plugins-disk_usage-DiskUsageProperty</string>
</cascading-job-properties>
<scm class="hudson.scm.NullSCM"/>
<canRoam>false</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>false</concurrentBuild>
<cleanWorkspaceRequired>false</cleanWorkspaceRequired>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?><project>
<actions/>
<description/>
<keepDependencies>false</keepDependencies>
<properties>
<hudson.plugins.disk__usage.DiskUsageProperty/>
</properties>
<scm class="hudson.plugins.git.GitSCM">
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<name>origin</name>
<refspec>+refs/heads/*:refs/remotes/origin/*</refspec>
<url>git@github.com:eclipse/gsc-ec-converter.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions/>
</scm>
<canRoam>false</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<jdk>jdk1.8.0-latest</jdk>
<triggers/>
<builders>
<hudson.tasks.Shell>
<command>export GRADLE_OPTS="-Dhttp.proxyHost=proxy.eclipse.org -Dhttp.proxyPort=9898 -Dhttps.proxyHost=proxy.eclipse.org -Dhttps.proxyPort=9898 -DhttpnonProxyHosts=*.eclipse.org -DhttpsnonProxyHosts=*.eclipse.org -Dftp.proxyHost=proxy.eclipse.org -Dftp.proxyPort=9898 -DftpnonProxyHosts=*.eclipse.org"

./gradlew clean build
cp build/distributions/gsc-ec-converter-*.zip /home/data/httpd/download.eclipse.org/collections/
cp build/distributions/gsc-ec-converter-*.tar /home/data/httpd/download.eclipse.org/collections/
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>

0 comments on commit 370eb1a

Please sign in to comment.