removed hard-coded Docker socket
This commit is contained in:
parent
3e5035c254
commit
eae495534b
2 changed files with 11 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue