summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Laughlin <clark.laughlin@linaro.org>2015-05-26 01:04:38 -0400
committerClark Laughlin <clark.laughlin@linaro.org>2015-05-26 01:04:38 -0400
commitbca16d98896e5ac32f70b5edce98ab3630f2e7ec (patch)
tree873cd9013b9113b1365dfdb6321a189497e17c22
parent90c80c45d654ba7c861ec084705c398d432a1e0a (diff)
setup to run in a Docker container, fix bug where not parsing command line args
-rwxr-xr-xdocker-start-containers18
-rw-r--r--tempest-pull/config.py2
-rw-r--r--web-app/Dockerfile33
-rwxr-xr-xweb-app/docker-build-image3
-rwxr-xr-xweb-app/docker-test-image2
-rw-r--r--web-app/server.go4
6 files changed, 61 insertions, 1 deletions
diff --git a/docker-start-containers b/docker-start-containers
new file mode 100755
index 0000000..4d6c878
--- /dev/null
+++ b/docker-start-containers
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# start the neo4j container
+docker run -d --name neo4j \
+ --privileged \
+ -p 127.0.0.1:7474:7474 \
+ -p 127.0.0.1:1337:1337 \
+ --restart=always \
+ -v /srv/ci-reporting/data:/var/lib/neo4j/data \
+ seenickcode/neo4j-community
+
+# start the web-app container, linked to the neo4j container
+docker run -d --name tempest-ci-webapp \
+ --privileged \
+ --link neo4j:neo4j \
+ -p 80:8081 \
+ tempest-ci-webapp
+
diff --git a/tempest-pull/config.py b/tempest-pull/config.py
index 32a8bb5..82f7e8e 100644
--- a/tempest-pull/config.py
+++ b/tempest-pull/config.py
@@ -5,7 +5,7 @@ config = dict(
LAVA_XMLRPC_ENDPOINT = "https://openstack.validation.linaro.org/RPC2",
# this is the URL of the Neo4J instance
-NEO4J_ENDPOINT = "http://neo4j:linaro@localhost:7474/db/data/",
+NEO4J_ENDPOINT = "http://localhost:7474/db/data/",
# this is the name of the bundle stream to retrieve from
BUNDLE_STREAM_NAME = "/public/team/openstack/tempest-ci/",
diff --git a/web-app/Dockerfile b/web-app/Dockerfile
new file mode 100644
index 0000000..934315a
--- /dev/null
+++ b/web-app/Dockerfile
@@ -0,0 +1,33 @@
+FROM ubuntu:14.04
+RUN apt-get update
+RUN apt-get install -y build-essential git wget curl mercurial
+
+RUN mkdir /goproj
+
+ENV GOPATH=/goproj
+ENV PATH=/goproj/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+
+# install golang from source
+RUN wget -qO- https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C /usr/local -xzf -
+
+# create gopath directories
+RUN mkdir -p /goproj
+RUN mkdir -p /goproj/bin
+RUN mkdir -p /goproj/pkg
+RUN mkdir -p /goproj/src/linaro.org/tempest-ci-webapp
+
+# get dependencies
+RUN go get github.com/gorilla/mux
+RUN go get github.com/jmcvetta/neoism
+
+# Copy the local package files to the container's workspace.
+ADD . /goproj/src/linaro.org/tempest-ci-webapp
+
+WORKDIR /goproj/src/linaro.org/tempest-ci-webapp
+RUN go install .
+
+# Run the outyet command by default when the container starts.
+ENTRYPOINT /goproj/bin/tempest-ci-webapp -dbserver=http://neo4j:7474/db/data/
+
+# Document that the service listens on port 8081.
+EXPOSE 8081
diff --git a/web-app/docker-build-image b/web-app/docker-build-image
new file mode 100755
index 0000000..cd0311b
--- /dev/null
+++ b/web-app/docker-build-image
@@ -0,0 +1,3 @@
+#!/bin/bash
+docker build -t tempest-ci-webapp .
+
diff --git a/web-app/docker-test-image b/web-app/docker-test-image
new file mode 100755
index 0000000..9d9f84c
--- /dev/null
+++ b/web-app/docker-test-image
@@ -0,0 +1,2 @@
+#!/bin/bash
+docker run --name test --link neo4j:neo4j -p 8081:8081 --rm -it --entrypoint /bin/bash tempest-ci-webapp
diff --git a/web-app/server.go b/web-app/server.go
index 916be35..b81f08d 100644
--- a/web-app/server.go
+++ b/web-app/server.go
@@ -526,6 +526,10 @@ func main() {
http.Handle("/", http.FileServer(http.Dir("./static/")))
// GO!
+
+ flag.Parse()
+ log.Println("neo4j server:", *neo4j_server)
+
err := http.ListenAndServe(*addr, nil)
if err != nil {
log.Fatal("http.ListenAndServe: ", err)