Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate all setting about log capture to nested settings #383

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ abstract class ComposeSettings {
r.waitForHealthyStateTimeout.set(waitForHealthyStateTimeout.get())
r.checkContainersRunning.set(checkContainersRunning.get())

r.captureContainersOutput.set(captureContainersOutput.get())
r.captureContainersOutput.set(this.captureContainersOutput.get())
r.captureContainersOutputToFile.set(this.captureContainersOutputToFile.getOrNull())
r.captureContainersOutputToFiles.set(this.captureContainersOutputToFiles.getOrNull())
r.composeLogToFile.set(this.composeLogToFile.getOrNull())
r.containerLogToDir.set(this.containerLogToDir.getOrNull())

r.projectNamePrefix = this.projectNamePrefix

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ class DockerComposePluginTest extends Specification {
project.dockerCompose.nested.ignorePushFailure.get() == true
}

def "configuration of log capturing is propagated to nested settings"() {
def project = ProjectBuilder.builder().build()
when:
project.plugins.apply 'docker-compose'
project.dockerCompose {
captureContainersOutput = true
captureContainersOutputToFiles = project.file('/path/to/directory')
nested {
useComposeFiles = ['test.yml']
}
}
then:
project.dockerCompose.nested.captureContainersOutput.get() == true
project.dockerCompose.nested.captureContainersOutputToFiles.get().getAsFile() == project.file('/path/to/directory')
}

def "isRequiredBy() adds dependencies"() {
def project = ProjectBuilder.builder().build()
project.plugins.apply 'docker-compose'
Expand Down