Skip to content

Commit

Permalink
Fix build for godeps and upgrade haproxy version
Browse files Browse the repository at this point in the history
  • Loading branch information
drewrobb committed Sep 23, 2016
1 parent 09954e8 commit 5bbbcc4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
27 changes: 26 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
FROM golang:1.6.2
# Need latest haproxy
FROM ubuntu:xenial

ENV DEBIAN_FRONTEND noninteractive

# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make curl openssl ca-certificates

ENV GOLANG_VERSION 1.7.1
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
ENV GOLANG_DOWNLOAD_SHA256 43ad621c9b014cde8db17393dc108378d37bc853aa351a6c74bf6432c1bbd182

RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \
&& tar -C /usr/local -xzf golang.tar.gz \
&& rm golang.tar.gz

ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH

RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH


RUN apt-get update -yqq && \
apt-get install -yqq software-properties-common && \
apt-get install -yqq haproxy git mercurial supervisor && \
rm -rf /var/lib/apt/lists/*


ADD . /go/src/github.com/QubitProducts/bamboo
ADD builder/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ADD builder/run.sh /run.sh
Expand Down
2 changes: 1 addition & 1 deletion configuration/marathon.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package configuration

import (
"github.com/QubitProducts/bamboo/Godeps/_workspace/src/github.com/samuel/go-zookeeper/zk"
"github.com/samuel/go-zookeeper/zk"
"strings"
"time"
)
Expand Down
7 changes: 6 additions & 1 deletion services/haproxy/haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ func GetTemplateData(config *conf.Configuration, storage service.Storage) (*temp
return nil, err
}

return &templateData{apps, services, config.HAProxy}, nil
byName := make(map[string]service.Service)
for _, service := range services {
byName[service.Id] = service
}

return &templateData{apps, byName, config.HAProxy}, nil
}
5 changes: 1 addition & 4 deletions services/marathon/marathon_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package marathon

import (
. "github.com/smartystreets/goconvey/convey"
"testing"

. "github.com/QubitProducts/bamboo/Godeps/_workspace/src/github.com/smartystreets/goconvey/convey"
conf "github.com/QubitProducts/bamboo/configuration"
"github.com/QubitProducts/bamboo/services/service"
)

func TestAcl(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions services/template/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package template

import (
"bytes"
"strings"
"text/template"

"github.com/QubitProducts/bamboo/services/marathon"
"github.com/QubitProducts/bamboo/services/service"
"strings"
"text/template"
)

func hasKey(data map[string]service.Service, appId string) bool {
Expand Down

0 comments on commit 5bbbcc4

Please sign in to comment.