-
Notifications
You must be signed in to change notification settings - Fork 6
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
Nested docker-compose configurations don't inherit composeFiles anymore #307
Comments
Are you sure that this was ever supported? The avast docker-compose plugin has this in their docs:
And that statement is there since version 0.12.2 (the behavior even earlier) |
It used to work with +=, now with add it does not anymore. I'm not sure that it works with the vanilla dockerCompose plugin. It's in our backlog to check it out. |
I tested with all plugin versions from 5.0.2 (the first version that introduced nested support) until 5.4.0 (the current latest version) I could not find any version that actually appends additional items to the list of the composeFiles when creating a nested configuration. By searching in all repositories, I can not find a single use of this behavior. However, I do see a pattern that can be mistaken for this behavior:
Test codepackage eu.xenit.gradle.docker.compose;
import static org.junit.Assert.assertEquals;
import com.avast.gradle.dockercompose.ComposeSettings;
import java.util.ArrayList;
import java.util.List;
import org.gradle.api.Project;
import org.gradle.testfixtures.ProjectBuilder;
import org.junit.Test;
public class DockerComposeExtensionOverrideTest {
@Test
public void nestedContainsParentComposeFiles() {
Project project = ProjectBuilder.builder().build();
project.getPluginManager().apply(DockerComposePlugin.class);
project.getExtensions().configure(DockerComposeExtensionOverride.class, dockerCompose -> {
dockerCompose.getUseComposeFiles().add("docker-compose-1.yml");
((ComposeSettings)dockerCompose.methodMissing("sub", new Object[0])).getUseComposeFiles().add("docker-compose-2.yml");
});
List<String> composeFiles = project.getExtensions().getByType(DockerComposeExtensionOverride.class).getUseComposeFiles();
List<String> subComposeFiles = ((ComposeSettings)project.getExtensions().getByType(DockerComposeExtensionOverride.class).propertyMissing("sub")).getUseComposeFiles();
assertEquals(new ArrayList<String>() {{
add("docker-compose.yml");
add("docker-compose-1.yml");
}}, composeFiles);
assertEquals(new ArrayList<String>() {{
add("docker-compose.yml");
add("docker-compose-1.yml");
add("docker-compose-2.yml");
}}, subComposeFiles);
}
} |
No description provided.
The text was updated successfully, but these errors were encountered: