Skip to content

Commit

Permalink
Merge pull request #24 from girvo/fixing-hostname
Browse files Browse the repository at this point in the history
Release v1.0.3
  • Loading branch information
girvo authored Nov 22, 2016
2 parents 6602542 + 270541b commit d93c71a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v1.0.3

- Removes the bindings between `VIRTUAL_HOST` and `hostname` (`-h` in the `docker run`) for the web container. This fixes the incorrect hostname format when a composite `VIRTUAL_HOST` is passed in via `env`

## v1.0.2

- Fixes a bug in v1.0.1 which broke "dup build"
Expand Down
2 changes: 1 addition & 1 deletion dup.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Package]
name = "dup"
version = "1.0.2"
version = "1.0.3"
author = "Josh Girvin <[email protected]>, Nathan Craike <[email protected]>"
description = "CLI wrapper for local Docker web development"
license = "MIT"
Expand Down
8 changes: 6 additions & 2 deletions src/container.nim
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,19 @@ proc startWebCmd*(conf: ProjectConfig, hasDb: bool = true): string {.raises: [],
noSideEffect.} =
var
hostname = conf.name & ".docker"
vhost = ""
for arg in conf.envVars:
if arg.name == "VIRTUAL_HOST":
hostname = arg.value
vhost = arg.value
let
link = if hasDB: "--link " & conf.db & ":db " else: ""
port = if conf.port == "": "" else: "-p " & conf.port
var folder = "-v $PWD/" & conf.volume
if conf.volume == "":
folder = "-v $PWD/code:/var/www"
var vhostEnv = ""
if vhost == "":
vhostEnv = "-e VIRTUAL_HOST=" & quoteShellPosix(vhost)

result = join([
"docker run",
Expand All @@ -148,7 +152,7 @@ proc startWebCmd*(conf: ProjectConfig, hasDb: bool = true): string {.raises: [],
folder,
link,
"-e TERM=xterm-256color",
"-e VIRTUAL_HOST=" & quoteShellPosix(hostname),
vhostEnv,
quoteShellPosix(conf.name & ":latest")
], " ")

Expand Down
2 changes: 1 addition & 1 deletion src/dup.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ from database import newDBConfig
from container import checkDockerfile, checkAndParseDupFile

## Define our version constant for re-use
const version = "dup 1.0.2"
const version = "dup 1.0.3"

## Define our docopt parsing schema
let doc = """
Expand Down

0 comments on commit d93c71a

Please sign in to comment.