removed hard-coded Docker socket

This commit is contained in:
Brad Rydzewski 2014-07-11 15:39:17 -07:00
parent 3e5035c254
commit eae495534b
2 changed files with 11 additions and 2 deletions

View file

@ -94,7 +94,7 @@ func main() {
queue := make(chan *worker.Request)
workers := make(chan chan *worker.Request)
worker.NewDispatch(queue, workers).Start()
worker.NewWorker(workers, users, repos, commits, configs, pubsub, &model.Server{Host: "unix:///tmp/sock.sock"}).Start()
worker.NewWorker(workers, users, repos, commits, configs, pubsub, &model.Server{}).Start()
// setup the session managers
sess := session.NewSession(users)

View file

@ -110,8 +110,17 @@ func (w *worker) Execute(r *Request) {
Depth: git.GitDepth(script.Git),
}
// Instantiate a new Docker client
var dockerClient *docker.Client
switch {
case len(w.server.Host) == 0:
dockerClient = docker.New()
default:
dockerClient = docker.NewHost(w.server.Host)
}
// create an instance of the Docker builder
builder := build.New(docker.NewHost(w.server.Host))
builder := build.New(dockerClient)
builder.Build = script
builder.Repo = repo
builder.Stdout = buf