Skip to content

Commit f7202d3

Browse files
authored
Pull createPipelineConfig task out of gradle plugin (#4)
1 parent 26d2e27 commit f7202d3

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

SequenceAnalysis/build.gradle

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import org.labkey.gradle.util.BuildUtils;
1+
import org.labkey.gradle.plugin.TeamCity
2+
import org.labkey.gradle.plugin.extension.ServerDeployExtension
3+
import org.labkey.gradle.plugin.extension.TeamCityExtension
4+
import org.labkey.gradle.util.BuildUtils
5+
import org.labkey.gradle.util.GroupNames
6+
import org.labkey.gradle.util.PropertiesUtils
7+
8+
import java.util.regex.Matcher
29

310
repositories {
411
jcenter()
@@ -22,4 +29,34 @@ dependencies {
2229
external("com.github.broadinstitute:picard:2.18.4") {
2330
exclude group: "javax.servlet", module: "servlet-api"
2431
}
32+
}
33+
34+
if (project.findProject(BuildUtils.getTestProjectPath(project.gradle)) != null && project.hasProperty("teamcity"))
35+
{
36+
def testProject = project.findProject(BuildUtils.getTestProjectPath(project.gradle))
37+
def createPipelineConfigTask = project.tasks.register("createPipelineConfig", Copy) {
38+
Copy task ->
39+
task.group = GroupNames.TEST_SERVER
40+
task.description = "Create pipeline configs for running tests on the test server"
41+
task.from project.file("test/configs")
42+
task.include "pipelineConfig.xml"
43+
task.filter({ String line ->
44+
Matcher matcher = PropertiesUtils.PROPERTY_PATTERN.matcher(line)
45+
def extension = testProject.extensions.findByType(TeamCityExtension.class)
46+
String newLine = line
47+
while (matcher.find())
48+
{
49+
if (matcher.group(1).equals("SEQUENCEANALYSIS_CODELOCATION") || matcher.group(1).equals("SEQUENCEANALYSIS_TOOLS"))
50+
newLine = newLine.replace(matcher.group(), extension.getTeamCityProperty("additional.pipeline.tools"))
51+
else if (matcher.group(1).equals("SEQUENCEANALYSIS_EXTERNALDIR"))
52+
newLine = newLine.replace(matcher.group(), project.file("pipeline_code/external").getAbsolutePath())
53+
}
54+
return newLine
55+
56+
})
57+
task.destinationDir = new File("${ServerDeployExtension.getServerDeployDirectory(project)}/config")
58+
}
59+
testProject.tasks.named("startTomcat").configure {
60+
dependsOn(createPipelineConfigTask)
61+
}
2562
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<beans xmlns="http://www.springframework.org/schema/beans"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
5+
6+
<bean id="pipelineJobService" class="org.labkey.pipeline.api.PipelineJobServiceImpl">
7+
<property name="configProperties">
8+
<bean class="org.labkey.pipeline.api.properties.ConfigPropertiesImpl">
9+
<property name="softwarePackages">
10+
<map>
11+
<!--This is the path to the checked out copy of the SequenceAnalysis perl code.
12+
sequence_tools_install.sh would have placed this in the path below-->
13+
<entry key="SEQUENCEANALYSIS_CODELOCATION" value="@@SEQUENCEANALYSIS_CODELOCATION@@"/>
14+
<!--This is the path where the /external directory from the SequenceAnalysis module is checked out.
15+
This contains several JARs. sequence_tools_install.sh would have placed these in the path below-->
16+
<entry key="SEQUENCEANALYSIS_EXTERNALDIR" value="@@SEQUENCEANALYSIS_EXTERNALDIR@@"/>
17+
<!--If the sequence tools are not in the standard pipeline tools dir, this is required.
18+
These are the external binaries installed by sequence_tools_install.sh-->
19+
<entry key="SEQUENCEANALYSIS_TOOLS" value="@@SEQUENCEANALYSIS_TOOLS@@"/>
20+
</map>
21+
</property>
22+
</bean>
23+
</property>
24+
</bean>
25+
</beans>

0 commit comments

Comments
 (0)