From 2275382e76428c8e848fc45f47eaf95146ca352e Mon Sep 17 00:00:00 2001
From: Alex <alexellis2@gmail.com>
Date: Tue, 24 Jan 2017 20:22:28 +0000
Subject: [PATCH] Add travis and fix Dockerfile for test files

---
 .travis.yml         | 10 ++++++++++
 build.sh            | 20 +++-----------------
 watchdog/Dockerfile |  9 ++++++++-
 3 files changed, 21 insertions(+), 18 deletions(-)
 create mode 100644 .travis.yml

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..23e6904a
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,10 @@
+sudo: required
+
+services:
+      - docker
+before_install:
+    - docker pull golang:1.7.3
+
+script:
+    - sh build.sh
+
diff --git a/build.sh b/build.sh
index 2b524325..2b3e6528 100755
--- a/build.sh
+++ b/build.sh
@@ -1,20 +1,6 @@
-#!/bin/sh
+#!/bin/bash
 
-# First do - git clone https://github.com/alexellis/faas && cd faas
+(cd gateway && ./build.sh)
+(cd watchdog && ./build.sh)
 
-docker network create --driver overlay --attachable functions
 
-cd watchdog
-./build.sh
-
-cp ./fwatchdog ../sample-functions/catservice/
-
-docker build --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy \
-    -t alexellis2/faas-catservice .
- #docker service rm catservice ; docker service create --network=functions --name catservice alexellis2/faas-catservice
-
-cd ..
-
-cd gateway
-./build.sh
-# docker rm -f server; docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name server -p 8080:8080 --network=functions alexellis2/faas-gateway
diff --git a/watchdog/Dockerfile b/watchdog/Dockerfile
index ea44643a..d78e326c 100644
--- a/watchdog/Dockerfile
+++ b/watchdog/Dockerfile
@@ -1,6 +1,13 @@
 FROM golang:1.7.3
 RUN mkdir -p /go/src/app
-COPY main.go /go/src/app
+WORKDIR /go/src/app
+COPY main.go        .
+COPY readconfig.go  .
+COPY config_test.go .
+
 WORKDIR /go/src/app
 RUN go get -d -v
+
+RUN go test
 RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
+
-- 
GitLab