Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Docker for Drupal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Composer
plugin
Docker for Drupal
Commits
e23684ec
Commit
e23684ec
authored
10 months ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
#78
Skip version in docker compose>=2.25
parent
9ab472b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!105
Merging develop into main
Pipeline
#1208370
passed with warnings
10 months ago
Stage: build
Stage: validate
Stage: release
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Handler.php
+23
-0
23 additions, 0 deletions
src/Handler.php
templates/docker-compose.yml.twig
+5
-0
5 additions, 0 deletions
templates/docker-compose.yml.twig
with
28 additions
and
0 deletions
src/Handler.php
+
23
−
0
View file @
e23684ec
...
...
@@ -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.
*
...
...
This diff is collapsed.
Click to expand it.
templates/docker-compose.yml.twig
+
5
−
0
View file @
e23684ec
{%
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
}}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment