Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Also listen for post.
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbollen committed Apr 9, 2015
1 parent f00afea commit 065a93d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,23 @@ func main() {
fmt.Println("Removing old container:", containerName)
client.RemoveContainer(docker.RemoveContainerOptions{ID: containerName, Force: true})
fmt.Println("Creating new container:", containerName)
container, _ := client.CreateContainer(create)
fmt.Println("Starting container:", container.ID)
client.StartContainer(container.ID, &hostConfig)
container, err := client.CreateContainer(create)
if err != nil {
fmt.Println("Unable to create new container:", err)
} else {
fmt.Println("Starting container:", container.ID)
client.StartContainer(container.ID, &hostConfig)
}
}
}()
m := martini.Classic()
m.Get(endpoint, func() string {
deploy <- 0
return "OK\n"
})
m.Post(endpoint, func() string {
deploy <- 0
return "OK\n"
})
m.RunOnAddr(":8080")
}

0 comments on commit 065a93d

Please sign in to comment.