Skip to content
Snippets Groups Projects
Commit e23684ec authored by jurgenhaas's avatar jurgenhaas
Browse files

#78 Skip version in docker compose>=2.25

parent 9ab472b7
No related branches found
No related tags found
1 merge request!105Merging develop into main
Pipeline #1208370 passed with warnings
......@@ -237,6 +237,11 @@ class Handler extends BaseHandler {
* {@inheritdoc}
*/
protected function postInit(): void {
$this->config->setValue('docker', [
'compose' => [
'version' => $this->readDockerComposeVersion(),
],
], FALSE);
$this->env->put('PHP_VERSION', $this->config->readValue(['php', 'version']), TRUE);
if ($this->isCiContext() || $this->isLocalDevMode()) {
......@@ -968,6 +973,24 @@ class Handler extends BaseHandler {
];
}
/**
* Get the version from docker compose.
*
* @return string
* The docker compose version.
*/
private function readDockerComposeVersion(): string {
try {
$output = [];
exec('docker compose version --short', $output);
return implode('', $output);
}
catch (\Exception) {
// Ignore.
}
return '0.0.0';
}
/**
* Get default configuration for backstop.
*
......
{% set v = docker.compose.version|split('.') %}
{% if (v[0] == 2 and v[1] >= 25) or v[0] > 2 %}
# Skipping version
{% else %}
version: '3.3'
{% endif %}
{% if drupal.live|default(0) %}
name: {{ projectname }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment