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

Commit bcf07f6

Browse files
committed
Merge pull request #23 from tcard/host-var
Add host variable to environment.
2 parents 3fcee6d + c033eb0 commit bcf07f6

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

core/dockerfile.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (d *Dockerfile) resolveInfoVariables(result []byte) []byte {
4040
"ENV": d.environment.Name,
4141
"VCS": string(d.project.Repository),
4242
"REV": d.revision.GetShort(),
43+
"HOST": d.environment.Host,
4344
}
4445

4546
for name, value := range vars {

core/types.go

+1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ type Environment struct {
209209
CertPath string `json:"-"`
210210
EtcdServers []string `gcfg:"EtcdServer"`
211211
Name string
212+
Host string `gcfg:"Host"`
212213
}
213214

214215
func (e *Environment) String() string {

documentation/configuration.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ An environment is a logical group of any number of Docker servers. Dockership su
5656

5757
* `DockerEndPoint` (mandatory, multiple): [Docker Remote API](https://docs.docker.com/reference/api/docker_remote_api/) address, if dockership and Docker are running in the same host you can use `unix:///var/run/docker.sock` if not you should enable remote access at the docker daemon (with -H parameter) and use a TCP endpoint. (eg.: `tcp://172.17.42.1:4243`)
5858

59+
* `Host` (optional): The hostname that the machine will be exposed at. Reachable thorugh the `DOCKERSHIP_HOST` variable in Dockerfiles.
60+
5961
* `CertPath` (optional): If you are running Docker with TLS support you must provide the path to your keys files, just like the [DOCKER_CERT_PATH](https://docs.docker.com/articles/https/) looks.
6062

6163
* `EtcdServer` (multiple, optional): if none is configured the `Global.EtcdServer` will be used
6264

63-
6465
### Project
6566

6667
`Project` section defines the configuration for every project to be deployed in the environments. The relation between repositories is one-to-one, so the repository should contain the `Dockerfile` and all the files needed to build the Docker image. The Project as Environment is defined as a section with subsection: `[Project "disruptive-app"]`

documentation/creating_your_dockerfiles.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ This kind of variables are sourced from the internal process of Dockerfile given
2121
* `$DOCKERSHIP_VCS`: Repository URLs, the `Repository` variable from the project.
2222
* `$DOCKERSHIP_REV`: Revision identifier
2323
* `$DOCKERSHIP_ENV`: Environment name where the Dockerfile is being deployed.
24+
* `$DOCKERSHIP_HOST`: Hostname of the environment.
2425

2526
### etcd support
2627

0 commit comments

Comments
 (0)