Skip to content

Commit

Permalink
Moving over dispatcher to gradle
Browse files Browse the repository at this point in the history
Signed-off-by: Fatih Ulusoy <ulusoy@de.ibm.com>
  • Loading branch information
markusthoemmes authored and Dominik Jall committed Mar 15, 2016
1 parent fabd985 commit 85f8d2c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 20 deletions.
1 change: 1 addition & 0 deletions core/dispatcher/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/bin/
/build/
.cache-main
10 changes: 4 additions & 6 deletions core/dispatcher/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ FROM whisk/scala
RUN wget -O /usr/bin/docker "https://get.docker.com/builds/Linux/x86_64/docker-1.9.0" && \
chmod +x /usr/bin/docker

EXPOSE 8080

# Copy app jars
COPY dispatcher.jar dispatcher-libs.tar startDispatcher.sh ./
RUN tar xf dispatcher-libs.tar && rm dispatcher-libs.tar && \
chmod +x startDispatcher.sh
COPY build/distributions/dispatcher.tar ./
RUN tar xf dispatcher.tar
CMD dispatcher/bin/dispatcher

EXPOSE 8080
29 changes: 29 additions & 0 deletions core/dispatcher/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apply plugin: 'scala'

sourceSets {
main {
scala {
srcDirs = ['src/']
}
resources {
srcDirs = ['src/']
}
}
}

dependencies {
compile project(':common:scala')
}

task distDocker(dependsOn:distTar, type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + project.name, '.'
}

mainClassName = "whisk.core.dispatcher.Dispatcher"
startScripts {
doLast {
def lines = unixScript.readLines()
lines[lines.size()-1] = lines.last() + ' >> /logs/$1_logs.log 2>&1'
unixScript.text = lines.join("\n")
}
}
3 changes: 1 addition & 2 deletions core/dispatcher/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<!-- targets in this file should be called from the parent directory -->
<project basedir="../..">
<import file="../../docker.xml" />
<import file="../../common/build.xml" />

<!-- build the docker image for the dispatcher service -->
<target name="compileDispatcher" depends="initScala">
Expand Down Expand Up @@ -119,7 +118,7 @@
<arg line="${consul.service.check}" />
<arg line="-v ${whisk.logs.dir}/activator:/logs" />
<arg line="-h activator_${main.docker.endpoint}" />
<arg line="-d --name activator ${docker.registry}whisk/dispatcher:${docker.image.tag} /startDispatcher.sh activator" />
<arg line="-d --name activator ${docker.registry}whisk/dispatcher:${docker.image.tag} /dispatcher/bin/dispatcher activator" />

This comment has been minimized.

Copy link
@rabbah

rabbah Mar 16, 2016

Member

The Dockerfile includes a run CMD dispatcher/bin/dispatcher but is that necessary?

</exec>
</target>

Expand Down
12 changes: 0 additions & 12 deletions core/dispatcher/startDispatcher.sh

This file was deleted.

0 comments on commit 85f8d2c

Please sign in to comment.