Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' for release 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalger committed Apr 22, 2021
2 parents c21c47e + 12f6a03 commit 34ed6ae
Show file tree
Hide file tree
Showing 28 changed files with 296 additions and 160 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-image-php-fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
php_version: ["7.2", "7.3", "7.4", "8.0"]
include:
# IonCube and Source Guardian loaders do not yet exist for PHP 8.0
- php_version: "8.0"
Expand All @@ -36,7 +36,7 @@ jobs:
needs: php-fpm
strategy:
matrix:
php_version: ["5.5", "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
php_version: ["7.2", "7.3", "7.4", "8.0"]
steps:
- uses: actions/checkout@v1
- run: ./images/scripts/build.sh --push "${BUILD_GROUP}"
Expand All @@ -52,7 +52,7 @@ jobs:
needs: php-fpm
strategy:
matrix:
php_version: ["7.0", "7.1", "7.2", "7.3", "7.4", "8.0"]
php_version: ["7.2", "7.3", "7.4", "8.0"]
steps:
- uses: actions/checkout@v1
- run: ./images/scripts/build.sh --push "${BUILD_GROUP}"
Expand Down
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# Change Log

## UNRELEASED [x.y.z](https://github.com/davidalger/warden/tree/x.y.z) (yyyy-mm-dd)
[All Commits](https://github.com/davidalger/warden/compare/0.10.2..develop)
[All Commits](https://github.com/davidalger/warden/compare/0.11.0..develop)

## Version [0.11.0](https://github.com/davidalger/warden/tree/0.11.0) (2021-04-22)
[All Commits](https://github.com/davidalger/warden/compare/0.10.2..0.11.0)

**Upgrade Notes:**

PHP and Varnish images have been rebuilt on a CentOS 8 base image (previously used a CentOS 7 base image). This eliminates the need for IUS for installing Git and MariaDB clients as these can now be installed from the default EL RPMs. This also allows for constants supported by more recent versions of Curl to be used in PHP code, latest calendar / locale features available in newer versions of ICU libraries to be used, etc.

Please note that builds for PHP versions 5.5, 5.6, 7.0 and 7.1 have been dropped. Images will remain on Docker Hub so they'll continue to be available for existing projects actively using them, they simply will see no further enhancements or maintenance.

To ensure you have the latest re-builds of Warden images and update your projects: `warden env pull && warden env up`

For full details on what went into these rebuilds, please see [#345](https://github.com/davidalger/warden/pull/345).

Huge shout out to @tdgroot who helped with updating the builds, testing, etc.

**Enhancements:**

* Shopware and Symfony environments will now use Composer v2 by default (issue [#359](https://github.com/davidalger/warden/issues/359))

## Version [0.10.2](https://github.com/davidalger/warden/tree/0.10.2) (2021-04-03)
[All Commits](https://github.com/davidalger/warden/compare/0.10.1..0.10.2)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Warden is a CLI utility for orchestrating Docker based developer environments, a
* [Warden Website](https://warden.dev/)
* [Warden Documentation](https://docs.warden.dev/)
* [Installing Warden](https://docs.warden.dev/installing.html)
* [Environment Types](https://docs.warden.dev/environments/types.html)
* [Initializing An Environment](https://docs.warden.dev/environments/initializing.html)
* [Environment Types](https://docs.warden.dev/environments.html)
* [Docker Images](https://docs.warden.dev/images.html)

## Features
Expand Down
2 changes: 1 addition & 1 deletion commands/env-init.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if [[ "${WARDEN_ENV_TYPE}" =~ ^symfony|shopware$ ]]; then
MARIADB_VERSION=10.4
NODE_VERSION=10
COMPOSER_VERSION=1
COMPOSER_VERSION=2
PHP_VERSION=7.4
PHP_XDEBUG_3=1
RABBITMQ_VERSION=3.8
Expand Down
18 changes: 7 additions & 11 deletions docs/configuration/dns-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,16 @@ If you desire to have more than this route through the `dnsmasq` container, you
1.0.0.1
```

#### Ubuntu systemd-resolved
#### systemd-resolved

`systemd-resolved` can we configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf`. Change the file to contain the following lines.
This approach works on most modern (systemd based) operating systems.

```text
DNS=127.0.0.1
Domains=~test
```

Restart the `systemd-resolved`
`systemd-resolved` can be configured to forward the requests of `.test` TLD to another DNS server. The configuration file is typically located at `/etc/systemd/resolved.conf` and `/etc/systemd/resolved.conf.d/*.conf`. Run the following commands to configure systemd-resolved:

```bash
sudo service systemd-resolved restart
```
sudo mkdir -p /etc/systemd/resolved.conf.d
echo -e "[Resolve]\nDNS=127.0.0.1\nDomains=~test\n" \
| sudo tee /etc/systemd/resolved.conf.d/warden.conf > /dev/null
sudo systemctl restart systemd-resolved

#### Ubuntu resolvconf

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/mftf.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We provide complex instruction on [How to run MFTF Tests](magento2-testing.html#

### Debugging MFTF Tests

By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`warden env up -d`)
By default Warden uses headless Chrome browser. If you want to preview the tests - you need to extend `.env` file and update environment containers (`warden env up`)

```
WARDEN_SELENIUM_DEBUG=1
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/multipledomains.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Multiple top-level domains may also be setup by following the instructions below
3. Configure the application to handle traffic coming from each of these domains appropriately. An example on this for Magento 2 environments may be found below.
4. Run `warden env up -d` to update the containers, after which each of the URLs should work as expected.
4. Run `warden env up` to update the containers, after which each of the URLs should work as expected.

``` note::
If these alternate domains must be resolvable from within the FPM containers, you must also leverage ``extra_hosts`` to add each specific sub-domain to the ``/etc/hosts`` file of the container as dnsmasq is used only on the host machine, not inside the containers. This should look something like the following excerpt.
Expand Down
3 changes: 2 additions & 1 deletion docs/environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
:glob:
environments/types
environments/initializing
environments/magento2
environments/shopware
environments/*
```
40 changes: 39 additions & 1 deletion docs/environments/customizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Further information on customizing or extending an environment is forthcoming. For now, this section is limited to very simple and somewhat common customizations.

To configure your project with a non-default PHP version, add the following to the project's `.env` file and run `warden env up -d` to re-create the affected containers:
To configure your project with a non-default PHP version, add the following to the project's `.env` file and run `warden env up` to re-create the affected containers:

PHP_VERSION=7.2

Expand All @@ -21,6 +21,44 @@ Start of some environments could be skipped by using variables in `.env` file:
* `WARDEN_DB=0`
* `WARDEN_REDIS=0`

### Docker Specific Customizations
To override default docker settings, add a custom configuration file in your project root
folder: `/.warden/warden-env.yml`
This file will be merged with the default environment configuration.
One example for a use case is [the setup of multiple domains](https://docs.warden.dev/configuration/multipledomains.html?highlight=warden%20env%20yml#multiple-domains).

### PHP Specific Customizations
To override default php settings, follow the docker customization above and include your custom `php.ini` file.
In this case the `warden-env.yml` should look like this:

```
version: "3.5"
services:
php-fpm:
volumes:
- ./.warden/php/zz-config.ini:/etc/php.d/zz-config.ini
php-debug:
volumes:
- ./.warden/php/zz-config.ini:/etc/php.d/zz-config.ini
```
Now add the referenced `.warden/php/zz-config.ini` file with your wanted changes.
For example you could change the error reporting value:
```
error_reporting=(E_ALL ^ E_DEPRECATED)
```
The config file will be merged with the default `01-php.ini` resp. override the values
included there. The default values are the following:
```
date.timezone = UTC
max_execution_time = 3600
max_input_vars = 10000
memory_limit = 2G
display_errors = On
post_max_size = 25M
session.auto_start = Off
upload_max_filesize = 25M
```

### Magento 1 Specific Customizations

If you use a `modman` structure, initialize the environment in your project path.
Expand Down
128 changes: 62 additions & 66 deletions docs/environments/initializing.md → docs/environments/magento2.md
Original file line number Diff line number Diff line change
@@ -1,92 +1,88 @@
## Initializing An Environment
## Installing Magento 2

The below example demonstrates the from-scratch setup of the Magento 2 application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that Warden has been previously started via `warden svc up` as part of the installation procedure.

``` note::
```note::
In addition to the below manual process, there is a `Github Template available for Magento 2 <https://github.com/davidalger/warden-env-magento2>`_ allowing for quick setup of new Magento projects. To use this, click the green "Use this template" button to create your own repository based on the template repository, run the init script and update the README with any project specific information.
```

1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started:
1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started:

mkdir -p ~/Sites/exampleproject
cd ~/Sites/exampleproject
mkdir -p ~/Sites/exampleproject
cd ~/Sites/exampleproject

2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project.
2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project.

warden env-init exampleproject magento2
warden env-init exampleproject magento2

The result of this command is a `.env` file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents:

WARDEN_ENV_NAME=exampleproject
WARDEN_ENV_TYPE=magento2
WARDEN_WEB_ROOT=/
WARDEN_ENV_NAME=exampleproject
WARDEN_ENV_TYPE=magento2
WARDEN_WEB_ROOT=/

TRAEFIK_DOMAIN=exampleproject.test
TRAEFIK_SUBDOMAIN=app
TRAEFIK_DOMAIN=exampleproject.test
TRAEFIK_SUBDOMAIN=app

WARDEN_DB=1
WARDEN_ELASTICSEARCH=1
WARDEN_VARNISH=1
WARDEN_RABBITMQ=1
WARDEN_REDIS=1
WARDEN_DB=1
WARDEN_ELASTICSEARCH=1
WARDEN_VARNISH=1
WARDEN_RABBITMQ=1
WARDEN_REDIS=1

WARDEN_SYNC_IGNORE=
WARDEN_SYNC_IGNORE=

ELASTICSEARCH_VERSION=7.6
MARIADB_VERSION=10.3
NODE_VERSION=10
COMPOSER_VERSION=1
PHP_VERSION=7.3
PHP_XDEBUG_3=1
RABBITMQ_VERSION=3.8
REDIS_VERSION=5.0
VARNISH_VERSION=6.0
ELASTICSEARCH_VERSION=7.6
MARIADB_VERSION=10.3
NODE_VERSION=10
COMPOSER_VERSION=1
PHP_VERSION=7.3
PHP_XDEBUG_3=1
RABBITMQ_VERSION=3.8
REDIS_VERSION=5.0
VARNISH_VERSION=6.0

WARDEN_ALLURE=0
WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
WARDEN_TEST_DB=0
WARDEN_MAGEPACK=0
BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=
WARDEN_ALLURE=0
WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0
WARDEN_SPLIT_SALES=0
WARDEN_SPLIT_CHECKOUT=0
WARDEN_TEST_DB=0
WARDEN_MAGEPACK=0

3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file):
BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=

warden sign-certificate exampleproject.test
3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file):

4. Next you'll want to start the project environment:
warden sign-certificate exampleproject.test

warden env up -d
4. Next you'll want to start the project environment:

``` warning::
If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up -d`` again.
```
warden env up

``` note::
On macOS when using Warden versions prior to 0.3.0, you will need to start the Mutagen sync session manually be running ``warden sync start`` whenever starting the environment. In Warden 0.3.0 and later the sync session is started and stopped automatically when running commands such as ``up``, ``start``, ``down``, and ``stop``.
```
```warning::
If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up`` again.
```

5. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into:
5. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into:

warden shell
warden shell

6. Configure global Magento Marketplace credentials
6. Configure global Magento Marketplace credentials

composer global config http-basic.repo.magento.com <username> <password>
composer global config http-basic.repo.magento.com <username> <password>

``` note::
```note::
To locate your authentication keys for Magento 2 repository, `reference DevDocs <https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html>`_.
If you have previously configured global credentials, you may skip this step, as ``~/.composer/`` is mounted into the container from the host machine in order to share composer cache between projects, and also shares the global ``auth.json`` from the host machine.
```

7. Initialize project source files using composer create-project and then move them into place:
7. Initialize project source files using composer create-project and then move them into place:

META_PACKAGE=magento/project-community-edition META_VERSION=2.4.x

Expand All @@ -96,7 +92,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati
rsync -a /tmp/exampleproject/ /var/www/html/
rm -rf /tmp/exampleproject/

8. Install the application and you should be all set:
8. Install the application and you should be all set:

## Install Application
bin/magento setup:install \
Expand Down Expand Up @@ -156,7 +152,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati
bin/magento indexer:reindex
bin/magento cache:flush

``` note::
```note::
Prior to Magento ``2.4.x`` it was not required to enter search-engine and elasticsearch configuration during installation and these params to ``setup:install`` are not supported by Magento ``2.3.x``. These should be omitted on older versions where not supported and Elasticsearch configured via ``config:set`` instead:
.. code::
Expand All @@ -169,7 +165,7 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati
bin/magento config:set --lock-env catalog/search/elasticsearch7_server_timeout 15
```

9. Generate an admin user and configure 2FA for OTP
9. Generate an admin user and configure 2FA for OTP

## Generate localadmin user
ADMIN_PASS="$(pwgen -n1 16)"
Expand Down Expand Up @@ -199,17 +195,17 @@ The below example demonstrates the from-scratch setup of the Magento 2 applicati
segno "${OTPAUTH_URL}" -s 4 -o "pub/media/${ADMIN_USER}-totp-qr.png"
printf "%s\n\n" "https://${TRAEFIK_SUBDOMAIN}.${TRAEFIK_DOMAIN}/media/${ADMIN_USER}-totp-qr.png?t=$(date +%s)"

``` note::
```note::
Use of 2FA is mandatory on Magento ``2.4.x`` and setup of 2FA should be skipped when installing ``2.3.x`` or earlier. Where 2FA is setup manually via UI upon login rather than using the CLI commands above, the 2FA configuration email may be retrieved from `the Mailhog service <https://mailhog.warden.test/>`_.
```

10. Launch the application in your browser:
10. Launch the application in your browser:

* [https://app.exampleproject.test/](https://app.exampleproject.test/)
* [https://app.exampleproject.test/backend/](https://app.exampleproject.test/backend/)
* [https://rabbitmq.exampleproject.test/](https://rabbitmq.exampleproject.test/)
* [https://elasticsearch.exampleproject.test/](https://elasticsearch.exampleproject.test/)
- [https://app.exampleproject.test/](https://app.exampleproject.test/)
- [https://app.exampleproject.test/backend/](https://app.exampleproject.test/backend/)
- [https://rabbitmq.exampleproject.test/](https://rabbitmq.exampleproject.test/)
- [https://elasticsearch.exampleproject.test/](https://elasticsearch.exampleproject.test/)

``` note::
```note::
To completely destroy the ``exampleproject`` environment we just created, run ``warden env down -v`` to tear down the project's Docker containers, volumes, etc.
```
Loading

0 comments on commit 34ed6ae

Please sign in to comment.