From 07bd16bcef234811be3be0c3df5ec100b716bcf9 Mon Sep 17 00:00:00 2001 From: iamluc Date: Mon, 7 Sep 2015 17:16:42 +0200 Subject: [PATCH 1/2] Remove trailing space Signed-off-by: iamluc --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 59bf200941..4e4f58dafd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -206,7 +206,7 @@ At this point, you have seen the basics of how Compose works. ## Release Notes -To see a detailed list of changes for past and current releases of Docker +To see a detailed list of changes for past and current releases of Docker Compose, please refer to the [CHANGELOG](https://github.com/docker/compose/blob/master/CHANGELOG.md). ## Getting help From 43049adc69391a8bfae6014eba7d1ac6ce61e300 Mon Sep 17 00:00:00 2001 From: iamluc Date: Mon, 7 Sep 2015 17:17:17 +0200 Subject: [PATCH 2/2] Allow using docker-compose.yml.dist file Signed-off-by: iamluc --- compose/config/config.py | 3 ++- tests/unit/config_test.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compose/config/config.py b/compose/config/config.py index d9b06f3e7d..78f7d32a61 100644 --- a/compose/config/config.py +++ b/compose/config/config.py @@ -71,6 +71,7 @@ SUPPORTED_FILENAMES = [ 'docker-compose.yml', + 'docker-compose.yml.dist', 'docker-compose.yaml', 'fig.yml', 'fig.yaml', @@ -109,7 +110,7 @@ def get_config_path(base_dir): winner = candidates[0] - if len(candidates) > 1: + if len(candidates) > 1 and not (len(candidates) == 2 and candidates[1].endswith('.dist')): log.warn("Found multiple config files with supported names: %s", ", ".join(candidates)) log.warn("Using %s\n", winner) diff --git a/tests/unit/config_test.py b/tests/unit/config_test.py index 3f602fb593..5949c40288 100644 --- a/tests/unit/config_test.py +++ b/tests/unit/config_test.py @@ -1059,6 +1059,7 @@ class GetConfigPathTestCase(unittest.TestCase): files = [ 'docker-compose.yml', + 'docker-compose.yml.dist', 'docker-compose.yaml', 'fig.yml', 'fig.yaml', @@ -1067,9 +1068,10 @@ class GetConfigPathTestCase(unittest.TestCase): def test_get_config_path_default_file_in_basedir(self): files = self.files self.assertEqual('docker-compose.yml', get_config_filename_for_files(files[0:])) - self.assertEqual('docker-compose.yaml', get_config_filename_for_files(files[1:])) - self.assertEqual('fig.yml', get_config_filename_for_files(files[2:])) - self.assertEqual('fig.yaml', get_config_filename_for_files(files[3:])) + self.assertEqual('docker-compose.yml.dist', get_config_filename_for_files(files[1:])) + self.assertEqual('docker-compose.yaml', get_config_filename_for_files(files[2:])) + self.assertEqual('fig.yml', get_config_filename_for_files(files[3:])) + self.assertEqual('fig.yaml', get_config_filename_for_files(files[4:])) with self.assertRaises(config.ComposeFileNotFound): get_config_filename_for_files([]) @@ -1081,9 +1083,10 @@ def get_config_in_subdir(files): return get_config_filename_for_files(files, subdir=True) self.assertEqual('docker-compose.yml', get_config_in_subdir(files[0:])) - self.assertEqual('docker-compose.yaml', get_config_in_subdir(files[1:])) - self.assertEqual('fig.yml', get_config_in_subdir(files[2:])) - self.assertEqual('fig.yaml', get_config_in_subdir(files[3:])) + self.assertEqual('docker-compose.yml.dist', get_config_in_subdir(files[1:])) + self.assertEqual('docker-compose.yaml', get_config_in_subdir(files[2:])) + self.assertEqual('fig.yml', get_config_in_subdir(files[3:])) + self.assertEqual('fig.yaml', get_config_in_subdir(files[4:])) with self.assertRaises(config.ComposeFileNotFound): get_config_in_subdir([])