Skip to content

Commit

Permalink
Merge pull request #29 from pzbitskiy/master
Browse files Browse the repository at this point in the history
Fixes #26: Pass environment to all docker-compose invocations
  • Loading branch information
augi authored Jun 14, 2016
2 parents bbf84be + 1477d6b commit 7d9b0f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ComposeDown extends DefaultTask {
void down() {
if (extension.stopContainers) {
project.exec { ExecSpec e ->
e.environment = extension.environment
e.commandLine extension.composeCommand('stop')
}
if (extension.removeContainers) {
Expand All @@ -36,10 +37,12 @@ class ComposeDown extends DefaultTask {
args += ['--volumes']
}
project.exec { ExecSpec e ->
e.environment = extension.environment
e.commandLine extension.composeCommand(args)
}
} else {
project.exec { ExecSpec e ->
e.environment = extension.environment
e.commandLine extension.composeCommand('rm', '-f')
}
}
Expand All @@ -50,6 +53,7 @@ class ComposeDown extends DefaultTask {
VersionNumber getDockerComposeVersion() {
new ByteArrayOutputStream().withStream { os ->
project.exec { ExecSpec e ->
e.environment = extension.environment
e.commandLine extension.composeCommand('--version')
e.standardOutput = os
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class ComposeUp extends DefaultTask {
String getContainerId(String serviceName) {
new ByteArrayOutputStream().withStream { os ->
project.exec { ExecSpec e ->
e.environment = extension.environment
e.commandLine extension.composeCommand('ps', '-q', serviceName)
e.standardOutput = os
}
Expand Down

0 comments on commit 7d9b0f7

Please sign in to comment.