Skip to content

Commit cb51c48

Browse files
committed
remove need to update docker compose (for now)
1 parent e08a4f5 commit cb51c48

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

birdhouse/pavics-compose.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,12 @@ if [ x"$1" = x"up" ]; then
128128
echo "COMPOSE_CONF_LIST="
129129
echo ${COMPOSE_CONF_LIST} | tr ' ' '\n' | grep -v '^-f'
130130

131+
cp "${COMPOSE_DIR}/docker-compose.yml" "${COMPOSE_FILE}"
132+
131133
# the PROXY_SECURE_PORT is a little trick to make the compose file invalid without the usage of this wrapper script
132-
PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker compose --project-directory "${BUILD_DIR}" ${COMPOSE_CONF_LIST} config -o "${COMPOSE_FILE}"
134+
PROXY_SECURE_PORT=443 HOSTNAME=${PAVICS_FQDN} docker-compose ${COMPOSE_CONF_LIST} config > "${COMPOSE_FILE}.final"
135+
136+
mv "${COMPOSE_FILE}.final" "${COMPOSE_FILE}"
133137
fi
134138

135139
docker compose -f "${COMPOSE_FILE}" "$@"

birdhouse/read-configs.include.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ create_compose_conf_list() {
211211

212212
[ -z "$BUILD_DIR" ] && return
213213

214-
COMPOSE_CONF_LIST="-f ${COMPOSE_DIR}/docker-compose.yml"
214+
COMPOSE_CONF_LIST="-f ${BUILD_DIR}/docker-compose.yml"
215215
COMPONENT_OVERRIDES=''
216216
LOADED_COMPONENTS=''
217217
for adir in $ALL_CONF_DIRS; do

tests/test_read_configs_include.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ def test_delayed_eval_custom_value(self, read_config_include_file) -> None:
177177

178178
class TestCreateComposeConfList:
179179
@staticmethod
180-
def default_conf_list_order(tmp_build_dir, root_dir) -> list[str]:
180+
def default_conf_list_order(tmp_build_dir) -> list[str]:
181181
return [
182-
f"{root_dir}/birdhouse/docker-compose.yml",
182+
f"{tmp_build_dir}/docker-compose.yml",
183183
f"{tmp_build_dir}/proxy/docker-compose-extra.yml",
184184
f"{tmp_build_dir}/canarie-api/config/proxy/docker-compose-extra.yml",
185185
f"{tmp_build_dir}/geoserver/docker-compose-extra.yml",
@@ -244,13 +244,13 @@ def run_func(self, include_file: str, local_env: dict, command_suffix: str = "")
244244
)
245245
return proc
246246

247-
def test_all_conf_dirs_empty(self, read_config_include_file, tmp_build_dir, root_dir):
247+
def test_all_conf_dirs_empty(self, read_config_include_file, tmp_build_dir):
248248
"""Test that only the base compose file is used when ALL_CONF_DIRS is empty"""
249249
proc = self.run_func(read_config_include_file, {"BUILD_DIR": tmp_build_dir}, 'echo "$COMPOSE_CONF_LIST"')
250-
assert split_and_strip(get_command_stdout(proc)) == [f"-f {root_dir}/birdhouse/docker-compose.yml"]
250+
assert split_and_strip(get_command_stdout(proc)) == [f"-f {tmp_build_dir}/docker-compose.yml"]
251251

252252
@pytest.mark.usefixtures("run_in_compose_dir")
253-
def test_compose_no_overrides(self, read_config_include_file, tmp_build_dir, root_dir):
253+
def test_compose_no_overrides(self, read_config_include_file, tmp_build_dir):
254254
"""Test that COMPOSE_CONF_LIST is set correctly when there are no overrides"""
255255
proc = self.run_func(
256256
read_config_include_file,
@@ -259,7 +259,7 @@ def test_compose_no_overrides(self, read_config_include_file, tmp_build_dir, roo
259259
)
260260
print(proc.stdout) # useful for debugging when assert fail
261261
assert split_and_strip(get_command_stdout(proc), split_on="-f") == [
262-
f"{root_dir}/birdhouse/docker-compose.yml",
262+
f"{tmp_build_dir}/docker-compose.yml",
263263
f"{tmp_build_dir}/finch/docker-compose-extra.yml",
264264
f"{tmp_build_dir}/raven/docker-compose-extra.yml",
265265
]
@@ -277,7 +277,7 @@ def test_compose_in_order(self, read_config_include_file):
277277
assert out1 == out2[:1] + out2[:0:-1]
278278

279279
@pytest.mark.usefixtures("run_in_compose_dir")
280-
def test_compose_overrides(self, read_config_include_file, tmp_build_dir, root_dir):
280+
def test_compose_overrides(self, read_config_include_file, tmp_build_dir):
281281
"""Test that COMPOSE_CONF_LIST is set correctly when there are overrides"""
282282
proc = self.run_func(
283283
read_config_include_file,
@@ -286,19 +286,18 @@ def test_compose_overrides(self, read_config_include_file, tmp_build_dir, root_d
286286
)
287287
print(proc.stdout) # useful for debugging when assert fail
288288
assert split_and_strip(get_command_stdout(proc), split_on="-f") == [
289-
f"{root_dir}/birdhouse/docker-compose.yml",
289+
f"{tmp_build_dir}/docker-compose.yml",
290290
f"{tmp_build_dir}/finch/docker-compose-extra.yml",
291291
f"{tmp_build_dir}/magpie/docker-compose-extra.yml",
292292
f"{tmp_build_dir}/finch/config/magpie/docker-compose-extra.yml",
293293
]
294294

295295
@pytest.mark.usefixtures("run_in_compose_dir")
296-
def test_default_all_conf_dirs(self, read_config_include_file, tmp_build_dir, root_dir):
296+
def test_default_all_conf_dirs(self, read_config_include_file, tmp_build_dir):
297297
proc = self.run_func(
298298
read_config_include_file,
299299
{"ALL_CONF_DIRS": " ".join(TestReadConfigs.default_all_conf_order), "BUILD_DIR": tmp_build_dir},
300300
'echo "$COMPOSE_CONF_LIST"',
301301
)
302302
print(proc.stdout) # useful for debugging when assert fail
303-
assert split_and_strip(get_command_stdout(proc), split_on="-f") == self.default_conf_list_order(tmp_build_dir,
304-
root_dir)
303+
assert split_and_strip(get_command_stdout(proc), split_on="-f") == self.default_conf_list_order(tmp_build_dir)

0 commit comments

Comments
 (0)