Skip to content

Commit

Permalink
Use composer version 2 as default (ddev#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Feb 26, 2021
1 parent 8cf313e commit c70f298
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion containers/ddev-webserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Build ddev-php-base from ddev-webserver-base
### ddev-php-base is the basic of ddev-php-prod (for DDEV-Live)
### and ddev-webserver-* (For DDEV-Local)
FROM drud/ddev-php-base:v0.7.12 as ddev-webserver-base
FROM drud/ddev-php-base:v0.7.13 as ddev-webserver-base

ENV BACKDROP_DRUSH_VERSION=1.4.0
ENV MKCERT_VERSION=v1.4.6
Expand Down
5 changes: 5 additions & 0 deletions containers/ddev-webserver/tests/ddev-webserver/general.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
docker exec $CONTAINER_NAME bash -c 'php --version | grep -v "with Xdebug"'
}

@test "verify that composer v2 is installed by default" {
v=$(docker exec $CONTAINER_NAME bash -c 'composer --version | awk "{ print $3;}"')
[[ "${v}" > "2." ]]
}

@test "verify there aren't \"closed keepalive connection\" complaints" {
(docker logs $CONTAINER_NAME 2>&1 | grep -v "closed keepalive connection") || (echo "Found unwanted closed keepalive connection messages" && exit 103)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/users/extend/config_yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ the .ddev/config.yaml is the primary configuration for the project.
| xdebug_enabled | "true" enables xdebug | Most people use `ddev xdebug` and `ddev xdebug off` instead of configuring this, because xdebug has a significant performance impact. |
| webserver_type | nginx-fpm or apache-fpm | The default is nginx-fpm, and it works best for many projects.|
| timezone | timezone to use in container and in PHP configuration | It can be set to any valid timezone, see [timezone list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example "Europe/Dublin" or "MST7MDT". The default is UTC. |
| composer_version | version of composer to use in web container and `ddev composer` | It can be left blank to get the default composer v1, or set to "1", for latest composer v1, "2" for latest composer v2, or to an explicit composer version. (Composer v1 is currently the default for ddev.) |
| composer_version | version of composer to use in web container and `ddev composer` | It can be left blank to get the default composer v1, or set to "1", for latest composer v1, "2" for latest composer v2, or to an explicit composer version. (Composer v2 is currently the default for ddev.) |
| additional_hostnames | array of extra hostnames | `additional_hostnames: ["somename", "someothername", "*.thirdname"]` would provide http and https URLs for "somename.ddev.site" and "someothername.ddev.site", as well as "one.thirdname.ddev.site" and "two.thirdname.ddev.site". Note that the wildcard/asterisk setting only works if you're using DNS to resolve hostnames (which is the default) and you're connected to the internet. |
| additional_fqdns | extra fully-qualified domain names | `additional_fqdns: ["example.com", "sub1.example.com"]` would provide http and https URLs for "example.com" and "sub1.example.com". Please take care with this because it can cause great confusion and adds extraneous items to your /etc/hosts file. |
| upload_dir | Relative path to upload directory used by `ddev import-files` | |
Expand Down
12 changes: 6 additions & 6 deletions pkg/ddevapp/composer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,23 @@ func TestComposerVersion(t *testing.T) {
require.NoError(t, err)
stdout, _, err := app.Exec(&ddevapp.ExecOpts{Cmd: "composer --version"})
assert.NoError(err)
assert.Contains(stdout, "Composer version 1")
assert.Contains(stdout, "Composer version 2")

// Make sure it does the right thing with latest 2.x
app.ComposerVersion = "2"
app.ComposerVersion = "1"
err = app.Start()
require.NoError(t, err)
stdout, _, err = app.Exec(&ddevapp.ExecOpts{Cmd: "composer --version"})
assert.NoError(err)
assert.Contains(stdout, "Composer version 2")
assert.Contains(stdout, "Composer version 1")

// With version "1" we should be back to latest v1
app.ComposerVersion = "1"
// With version "2" we should be back to latest v2
app.ComposerVersion = "2"
err = app.Start()
require.NoError(t, err)
stdout, _, err = app.Exec(&ddevapp.ExecOpts{Cmd: "composer --version"})
assert.NoError(err)
assert.Contains(stdout, "Composer version 1")
assert.Contains(stdout, "Composer version 2")

// With explicit version, we should get that version
app.ComposerVersion = "2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/ddevapp/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ const ConfigInstructions = `
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# composer_version: "2"
# composer_version: ""
# if composer_version:"" it will use the current ddev default composer release.
# It can also be set to "1", to get most recent composer v1
# or "2" for most recent composer v2.
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var DockerComposeFileFormatVersion = "3.6"
var WebImg = "drud/ddev-webserver"

// WebTag defines the default web image tag for drud dev
var WebTag = "20210222_magerun" // Note that this can be overridden by make
var WebTag = "20210224_composer_2_default" // Note that this can be overridden by make

// DBImg defines the default db image used for applications.
var DBImg = "drud/ddev-dbserver"
Expand Down

0 comments on commit c70f298

Please sign in to comment.