Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-up services basis #27

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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('-', '.')
Expand Down
37 changes: 20 additions & 17 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include 'runner'
include 'listener'
//include 'runner'
//include 'listener'
include 'serviceDiscovery'

rootProject.name = 'pipeline'
rootProject.children.each { project ->
Expand Down
18 changes: 18 additions & 0 deletions subprojects/serviceDiscovery/serviceDiscovery.gradle
Original file line number Diff line number Diff line change
@@ -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'
}
Original file line number Diff line number Diff line change
@@ -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()
}
}

Original file line number Diff line number Diff line change
@@ -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<ServiceDiscoveryConfiguration> {

@Override
void initialize(Bootstrap<ServiceDiscoveryConfiguration> bootstrap) {
}

@Override
void run(ServiceDiscoveryConfiguration config, Environment env) throws Exception {
env.jersey().register(new RootResource())
env.jersey().register(new PingResource())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.pipelinelabs.pipeline.servicediscovery

import io.dropwizard.Configuration

class ServiceDiscoveryConfiguration extends Configuration {
}
Original file line number Diff line number Diff line change
@@ -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()
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}