Skip to content
This repository was archived by the owner on Mar 30, 2020. It is now read-only.

Commit 714582c

Browse files
committed
Allowing Volumes in projects #18
1 parent 3bbee51 commit 714582c

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

core/docker.go

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ func (d *Docker) startContainer(p *Project, c *Container) error {
292292
PortBindings: ports,
293293
RestartPolicy: restartPolicy,
294294
Links: d.formatLinks(p.Links),
295+
VolumesFrom: p.Volumes,
295296
})
296297
}
297298

core/docker_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ func (s *CoreSuite) TestDocker_Run(c *C) (p *Project, m *testing.DockerServer, r
112112
c.Assert(l[0].IsRunning(), Equals, true)
113113
c.Assert(l[0].Names, HasLen, 1)
114114
c.Assert(l[0].Names[0], Equals, "/foo")
115+
115116
return
116117
}
117118

core/project.go

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type Project struct {
2929
NoCache bool
3030
Restart string
3131
Ports []string `gcfg:"Port"`
32+
Volumes []string `gcfg:"Volume"`
3233
Links map[string]*Link `json:"-"`
3334
LinkNames []LinkDefinition `gcfg:"Link"`
3435
LinkedBy []*Project `json:"-"`

documentation/configuration.md

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ An environment is a logical group of any number of Docker servers. Dockership su
7373
* `Port` (multiple, optional): container port to expose, format: `<host-addr>:<host-port>:<container-port>/<proto>` (like -p at `docker run`), additionaly the port can be configured just for one enviroment adding it to end of the port preceded by a `@` (eg: `2.2.2.2:80:80/tcp@live`)
7474
* `Restart` (optional, default: no): restart policy to apply when a container exits (no, on-failure[:max-retry], always) (like --restart at `docker run`)
7575
* `Link` (multiple, optional): creates a Link to other project, when this project is deployed the linked projects are restarted (like -P at `docker run`)
76+
* `Volume` (multiple, optional): mounts a Data Volume Container (like -v at `docker run`)
7677
* `GithubToken` (default: Global.GithubToken): the token needed to access this repository, if it is different from the global one.
7778
* `Environment` (multiple, mandatory): Environment name where this project could be deployed
7879
* `WebHook` (optional): An HTTP address to which a POST request will be sent when a deploy succeeds for this project. The request will have a JSON object body with keys `previous_revision`, `current_revision`, `project`, `environment` and `errors`.

0 commit comments

Comments
 (0)