Skip to content

Commit

Permalink
Merge pull request #59 from Kazaag/master
Browse files Browse the repository at this point in the history
Allow to specify location of the docker-compose executable
  • Loading branch information
augi authored Feb 3, 2017
2 parents 7557192 + ab56746 commit bf4ea07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ dockerCompose {
// removeImages = "None" // Other accepted values are: "All" and "Local"
// removeVolumes = false
// projectName = 'my-project' // allow to set custom docker-compose project name (defaults to directory name)
// executable = '/path/to/docker-compose' // allow to set the path of the docker-compose executable if not present in PATH
// environment.put 'BACKEND_ADDRESS', '192.168.1.100' // Pass environment variable to 'docker-compose' for substitution in compose file
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ComposeExtension {
RemoveImages removeImages = RemoveImages.None
boolean removeVolumes = true

String executable = 'docker-compose'
Map<String, Object> environment = new HashMap<String, Object>(System.getenv());

ComposeExtension(Project project, ComposeUp upTask, ComposeDown downTask) {
Expand Down Expand Up @@ -79,7 +80,7 @@ class ComposeExtension {
*/
@PackageScope
Iterable<String> composeCommand(String... args) {
def res = ['docker-compose']
def res = [executable]
res.addAll(useComposeFiles.collectMany { ['-f', it] })
if (projectName) {
res.addAll(['-p', projectName])
Expand Down

0 comments on commit bf4ea07

Please sign in to comment.