diff --git a/build.gradle b/build.gradle index 947bc7b..074750b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ apply from: script('requireJavaVersion7') apply from: script('dependencies') -apply plugin: 'distribution' +//apply plugin: 'distribution' description = 'Pipeline --the Continuous Delivery (CD) tool, which we and all stakeholders of the CD pipeline love to use' group = 'org.pipelinelabs.pipeline' @@ -18,25 +18,25 @@ subprojects { version = rootProject.version } -distributions { - main { - contents { - into('bin') { - from { project(':listener').startScripts.outputs.files } - from { project(':runner').startScripts.outputs.files } - fileMode = 0755 - } - into('lib') { - def libs = [] - libs << project(':listener').configurations.runtime - project(':runner').configurations.runtime - libs << project(':runner').configurations.runtime - from libs - from project(':listener').jar - from project(':runner').jar - } - } - } -} +//distributions { +// main { +// contents { +// into('bin') { +// from { project(':listener').startScripts.outputs.files } +// from { project(':runner').startScripts.outputs.files } +// fileMode = 0755 +// } +// into('lib') { +// def libs = [] +// libs << project(':listener').configurations.runtime - project(':runner').configurations.runtime +// libs << project(':runner').configurations.runtime +// from libs +// from project(':listener').jar +// from project(':runner').jar +// } +// } +// } +//} String createProjectGroupId(Project root, Project project) { root.group << '.' << project.name.replaceAll('-', '.') diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index c4da2a7..b338f20 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -4,32 +4,35 @@ ext { } versions += [ - groovy: '2.1.7', - dropwizard: '0.6.2', + groovy : '2.1.7', +// dropwizard: '0.6.2', + dropwizard: '0.7.0-rc2', ] libraries += [ - mavenSharedUtils: 'org.apache.maven.shared:maven-shared-utils:0.4', - groovy: "org.codehaus.groovy:groovy:${versions.groovy}", - groovyJson: "org.codehaus.groovy:groovy-json:${versions.groovy}", - mail: 'javax.mail:mail:1.4.7', + mavenSharedUtils : 'org.apache.maven.shared:maven-shared-utils:0.4', + groovy : "org.codehaus.groovy:groovy:${versions.groovy}", + groovyJson : "org.codehaus.groovy:groovy-json:${versions.groovy}", + mail : 'javax.mail:mail:1.4.7', springContextSupport: 'org.springframework:spring-context-support:3.2.4.RELEASE', - junit: 'junit:junit:4.11', - asm: 'org.ow2.asm:asm:4.1', - hamcrest: 'org.hamcrest:hamcrest-library:1.3', - jcommander: 'com.beust:jcommander:1.32', - dropwizardTesting: "com.yammer.dropwizard:dropwizard-testing:${versions.dropwizard}", + junit : 'junit:junit:4.11', + asm : 'org.ow2.asm:asm:4.1', + hamcrest : 'org.hamcrest:hamcrest-library:1.3', + jcommander : 'com.beust:jcommander:1.32', +// dropwizardTesting: "com.yammer.dropwizard:dropwizard-testing:${versions.dropwizard}", + dropwizardTesting : "io.dropwizard:dropwizard-testing:${versions.dropwizard}", + dropwizard : "io.dropwizard:dropwizard-core:${versions.dropwizard}", ] -libraries.dropwizard = ["com.yammer.dropwizard:dropwizard-core:${versions.dropwizard}", - 'com.sun.jersey:jersey-client:1.17.1', -] +//libraries.dropwizard = ["com.yammer.dropwizard:dropwizard-core:${versions.dropwizard}", +// 'com.sun.jersey:jersey-client:1.17.1', +//] libraries.spock = ['org.spockframework:spock-core:0.7-groovy-2.0', - libraries.groovy, - 'org.objenesis:objenesis:2.0', - 'cglib:cglib-nodep:2.2' + libraries.groovy, + 'org.objenesis:objenesis:2.0', + 'cglib:cglib-nodep:2.2' ] allprojects { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 8f08c70..5befd28 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Aug 14 00:59:45 CEST 2013 +#Fri Mar 21 17:55:05 CET 2014 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip +distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip diff --git a/settings.gradle b/settings.gradle index ec5b303..6f125b8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ -include 'runner' -include 'listener' +//include 'runner' +//include 'listener' +include 'serviceDiscovery' rootProject.name = 'pipeline' rootProject.children.each { project -> diff --git a/subprojects/serviceDiscovery/serviceDiscovery.gradle b/subprojects/serviceDiscovery/serviceDiscovery.gradle new file mode 100644 index 0000000..84ea628 --- /dev/null +++ b/subprojects/serviceDiscovery/serviceDiscovery.gradle @@ -0,0 +1,18 @@ +apply plugin: 'groovy' +apply plugin: 'application' + +applicationName = 'pipe-servicediscovery' +description = 'pipe-servicediscovery --central service discovery service' +mainClassName = 'org.pipelinelabs.pipeline.servicediscovery.Main' + +dependencies { + compile libraries.dropwizard + compile libraries.groovy + compile libraries.groovyJson + testCompile libraries.spock + testCompile libraries.dropwizardTesting +} + +run { + args 'server' +} diff --git a/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/Main.groovy b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/Main.groovy new file mode 100644 index 0000000..a841f10 --- /dev/null +++ b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/Main.groovy @@ -0,0 +1,15 @@ +package org.pipelinelabs.pipeline.servicediscovery + +import io.dropwizard.Application + +class Main { + + static void main(String... args) { + new Main().createApplication().run(args) + } + + Application createApplication() { + new ServiceDiscoveryApplication() + } +} + diff --git a/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryApplication.groovy b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryApplication.groovy new file mode 100644 index 0000000..fd27fff --- /dev/null +++ b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryApplication.groovy @@ -0,0 +1,20 @@ +package org.pipelinelabs.pipeline.servicediscovery + +import io.dropwizard.Application +import io.dropwizard.setup.Bootstrap +import io.dropwizard.setup.Environment +import org.pipelinelabs.pipeline.servicediscovery.resources.PingResource +import org.pipelinelabs.pipeline.servicediscovery.resources.RootResource + +class ServiceDiscoveryApplication extends Application { + + @Override + void initialize(Bootstrap bootstrap) { + } + + @Override + void run(ServiceDiscoveryConfiguration config, Environment env) throws Exception { + env.jersey().register(new RootResource()) + env.jersey().register(new PingResource()) + } +} diff --git a/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryConfiguration.groovy b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryConfiguration.groovy new file mode 100644 index 0000000..2f82964 --- /dev/null +++ b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/ServiceDiscoveryConfiguration.groovy @@ -0,0 +1,6 @@ +package org.pipelinelabs.pipeline.servicediscovery + +import io.dropwizard.Configuration + +class ServiceDiscoveryConfiguration extends Configuration { +} diff --git a/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/PingResource.groovy b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/PingResource.groovy new file mode 100644 index 0000000..76bc874 --- /dev/null +++ b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/PingResource.groovy @@ -0,0 +1,20 @@ +package org.pipelinelabs.pipeline.servicediscovery.resources + +import io.dropwizard.jersey.caching.CacheControl + +import javax.ws.rs.GET +import javax.ws.rs.Path +import javax.ws.rs.core.Response + +import static javax.ws.rs.core.MediaType.TEXT_PLAIN_TYPE + +@Path('/ping') +class PingResource { + private static final String CONTENT = "pong"; + + @GET + @CacheControl(mustRevalidate = true, noCache = true, noStore = true) + def get() { + return Response.ok(CONTENT).type(TEXT_PLAIN_TYPE).build() + } +} diff --git a/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/RootResource.groovy b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/RootResource.groovy new file mode 100644 index 0000000..296e5ce --- /dev/null +++ b/subprojects/serviceDiscovery/src/main/groovy/org/pipelinelabs/pipeline/servicediscovery/resources/RootResource.groovy @@ -0,0 +1,13 @@ +package org.pipelinelabs.pipeline.servicediscovery.resources + +import javax.ws.rs.GET +import javax.ws.rs.Path + +@Path('/') +class RootResource { + + @GET + def get() { + return "hello" + } +}