Skip to content

Commit

Permalink
Merge pull request #244 from lemberg/chore/release30400
Browse files Browse the repository at this point in the history
Prepare release 3.4.0
  • Loading branch information
T2L committed Aug 5, 2021
2 parents 3d7a3e0 + 2ee05e7 commit fe7ee15
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 45 deletions.
67 changes: 46 additions & 21 deletions .github/workflows/Integrate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ jobs:
php-version: ${{ matrix.php-version }}
tools: composer:v${{ matrix.composer-version }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.lock') }}
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-

- name: Install Composer dependencies
Expand Down Expand Up @@ -83,6 +88,8 @@ jobs:

strategy:
matrix:
composer-version:
- 2
php-version:
- '7.4'
python-version:
Expand All @@ -100,17 +107,22 @@ jobs:
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: composer:v1, prestissimo
tools: composer:v${{ matrix.composer-version }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader --no-dev
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev

- name: Install Python
uses: actions/setup-python@v2
Expand All @@ -120,12 +132,11 @@ jobs:
- name: Cache PiP dependencies
uses: actions/cache@v2
with:
path: ~/Library/Caches/pip
key: python-${{ matrix.python-version }}
restore-keys: python-${{ matrix.python-version }}-
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.molecule-platform }}

- name: Install Molecule and it's dependencies
run: pip install ansible==2.9.* ansible-lint yamllint molecule~=3.1 python-vagrant molecule-vagrant
run: pip install --upgrade --upgrade-strategy eager ansible==4.* ansible-lint yamllint molecule python-vagrant molecule-vagrant

- name: Run Molecule tests
run: molecule test
Expand All @@ -141,6 +152,8 @@ jobs:

strategy:
matrix:
composer-version:
- 2
php-version:
- '7.4'
vagrant-box:
Expand All @@ -162,17 +175,22 @@ jobs:
with:
coverage: none
php-version: ${{ matrix.php-version }}
tools: composer:v1, prestissimo
tools: composer:v${{ matrix.composer-version }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader --no-dev
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader --no-dev

- name: Set Vagrant box to use
run: sed -i '' 's/focal64/${{ matrix.vagrant-box }}/g' default.vm-settings.yml
Expand All @@ -189,6 +207,8 @@ jobs:

strategy:
matrix:
composer-version:
- 2
php-version:
- 7.4

Expand All @@ -209,17 +229,22 @@ jobs:
with:
coverage: xdebug
php-version: ${{ matrix.php-version }}
tools: composer:v1, prestissimo
tools: composer:v${{ matrix.composer-version }}

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: php-${{ matrix.php-version }}-${{ hashFiles('composer.lock') }}
restore-keys: php-${{ matrix.php-version }}-
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-${{ hashFiles('composer.json') }}
restore-keys: php-${{ matrix.php-version }}-${{ matrix.composer-version }}-

- name: Install Composer dependencies
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader
run: composer install --no-interaction --no-progress --prefer-dist --optimize-autoloader

- name: Collect code coverage
run: vendor/bin/phpunit --testsuite=unit --coverage-clover=coverage.xml
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## Draft Environment (Unreleased)

Updates:

- Updated Ansible roles:
* oefenweb.swapfile (v2.0.33 => v2.0.34)
* geerlingguy.mysql (3.3.1 => 3.3.2)
* t2l.composer (2.0.4 => 2.0.5)

## Draft Environment 3.3.3 (2021-07-12)

Updates:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ Dramatically increases disk IO on Windows by adding NFS support.
Here's the list of used roles:

- draft (internal)
- [oefenweb.swapfile @ v2.0.33](https://github.com/Oefenweb/ansible-swapfile/tree/v2.0.33)
- [oefenweb.swapfile @ v2.0.34](https://github.com/Oefenweb/ansible-swapfile/tree/v2.0.34)
- [geerlingguy.mailhog @ 2.2.0](https://github.com/geerlingguy/ansible-role-mailhog/tree/2.2.0)
- git_config (internal)
- apache2 (internal)
- [geerlingguy.mysql @ 3.3.1](https://github.com/geerlingguy/ansible-role-mysql/tree/3.3.1)
- [geerlingguy.mysql @ 3.3.2](https://github.com/geerlingguy/ansible-role-mysql/tree/3.3.2)
- [t2l.php @ 1.5.0](https://github.com/T2L/ansible-role-php/tree/1.5.0)
- [t2l.composer @ 2.0.4](https://github.com/T2L/ansible-role-composer/tree/2.0.4)
- [t2l.composer @ 2.0.5](https://github.com/T2L/ansible-role-composer/tree/2.0.5)
- [t2l.java @ 1.3.3](https://github.com/T2L/ansible-role-java/tree/1.3.3)
- [t2l.solr @ 2.2.2](https://github.com/T2L/ansible-role-solr/tree/2.2.2)

Expand Down
23 changes: 16 additions & 7 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Run Ansible provisioner from within the virtual machine using Ansible Local
# provisioner.

# Use PiP version < 21 for Ubuntu 16.04.
get_pip_url = configuration.get("vagrant.box") === "ubuntu/xenial64" ? "https://bootstrap.pypa.io/pip/3.5/get-pip.py" : "https://bootstrap.pypa.io/pip/get-pip.py"

config.vm.provision "ansible_local" do |ansible|
ansible.become = true
ansible.playbook = "playbook.yml"
Expand All @@ -242,14 +239,26 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
ansible.galaxy_roles_path = "/etc/ansible/roles"
ansible.galaxy_command = "sudo ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path} --force"
ansible.compatibility_mode = "2.0"
ansible.install_mode = "pip"
ansible.install_mode = "pip_args_only"
ansible.pip_install_cmd = <<-SHELL
# Ensure that required Python packsges are present.
# Ensure that required Python packages are present.
sudo apt install python3-apt python3-distutils -y
# Install PiP.
curl #{get_pip_url} | sudo python3
curl https://bootstrap.pypa.io/get-pip.py | sudo python3
SHELL
ansible.version = configuration.get("ansible.version")
# The following will not work properly since the split of Ansible into ansible-base (soon ansible-core)
# and the Ansible collections and modules both together resembling Ansible.
# `ansible --version` will yield the ansible-base version and this command is used by ansible_local.
# It is not suitable to figure out which Ansible distribution/bundle was installed.
# To workaround the wrongful mismatch result when installing Ansible through Vagrant,
# we have to leave ansible.version empty/unset and use ansible.pip_args to provide the desired version.
#
# See also:
# - https://www.ansible.com/blog/ansible-3.0.0-qa
# - https://github.com/hashicorp/vagrant/issues/12204
# - https://git.jotbe.io/jotbe/ansible-devops-vm/commit/972e6c0d87d09cca4397fc8eba0885de04046673
# ansible.version = configuration.get("ansible.version")
ansible.pip_args = "ansible==" + configuration.get("ansible.version")
end

# Display an informational message to the user.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"t2l/comments": "^1.1.0"
},
"require-dev": {
"composer/composer": "^1.10 || ^2.0",
"composer/composer": "^1.10 || ^2.0.13",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"dg/bypass-finals": "^1.2.2",
"drupal/coder": "^8.3.8",
Expand Down
16 changes: 8 additions & 8 deletions default.vm-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ virtualbox:
cpuexecutioncap: 100
# VirtualBox disk size (added by vagrant-disksize plugin).
# See https://github.com/sprotheroe/vagrant-disksize
disk_size: 10GB
disk_size: 40GB

# Ansible local configuration.
ansible:
Expand All @@ -80,8 +80,8 @@ ansible:
# installs the latest available Ansible version within the given range
# constraint. This is the default option.
#
# This project has been successfully tested with Ansible 2.9.
version: '2.9.*'
# This project has been successfully tested with Ansible 4.0.
version: '4.*'

# List of features to install. Some roles depend on each other, be careful.
draft_features:
Expand All @@ -105,7 +105,7 @@ draft_features:

ssh_default_directory: '{{ vagrant.destination_directory }}'

# Role: oefenweb.swapfile @ v2.0.33
# Role: oefenweb.swapfile @ v2.0.34

# Set swap file size.
swapfile_size: 2GB
Expand All @@ -129,7 +129,7 @@ apache2_document_root: docroot
# Log level to use
apache2_log_level: error

# Role: geerlingguy.mysql @ 3.3.1
# Role: geerlingguy.mysql @ 3.3.2

# Set this to the user ansible is logging in as - should have root
# or sudo access
Expand Down Expand Up @@ -173,7 +173,7 @@ mysql_port: '3306'
mysql_bind_address: 0.0.0.0
mysql_skip_name_resolve: false
mysql_datadir: /var/lib/mysql
mysql_sql_mode: ''
mysql_sql_mode: ~
mysql_pid_file: /var/run/mysqld/mysqld.pid
mysql_socket: /var/run/mysqld/mysqld.sock

Expand Down Expand Up @@ -309,7 +309,7 @@ php_extensions_configuration:
opcache.error_log: /var/log/draft/php_opcache_error.log
xdebug:
xdebug.mode: debug
xdebug.discover_client_host: true
xdebug.discover_client_host: 'true'
xdebug.remote_log: /var/log/draft/php_xdebug_remote.log

# Web server daemon to restart (defaults to Apache 2).
Expand All @@ -318,7 +318,7 @@ php_web_server_daemon: apache2
# Boolean indicating whether to restart web server or not.
php_restart_web_server: true

# Role: t2l.composer @ 2.0.4
# Role: t2l.composer @ 2.0.5

# Composer installation directory.
composer_install_dir: /usr/local/bin
Expand Down
6 changes: 3 additions & 3 deletions provisioning/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
- src: oefenweb.swapfile
version: v2.0.33
version: v2.0.34
- src: geerlingguy.mailhog
version: 2.2.0
- src: geerlingguy.mysql
version: 3.3.1
version: 3.3.2
- src: t2l.php
version: 1.5.0
- src: t2l.composer
version: 2.0.4
version: 2.0.5
- src: t2l.java
version: 1.3.3
- src: t2l.solr
Expand Down
1 change: 1 addition & 0 deletions provisioning/roles/draft/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- name: Ensure packages required by Solr role are installed
apt:
name:
- acl
- libxml2-dev
- libxslt-dev
- python3-dev
Expand Down
2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class App {

public const PACKAGE_NAME = 'lemberg/draft-environment';

public const LAST_AVAILABLE_UPDATE_WEIGHT = 9;
public const LAST_AVAILABLE_UPDATE_WEIGHT = 10;

/**
* @var \Composer\Composer
Expand Down
62 changes: 62 additions & 0 deletions src/Config/Update/Step/Cleanup30400.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

declare(strict_types=1);

namespace Lemberg\Draft\Environment\Config\Update\Step;

use Lemberg\Draft\Environment\Config\Update\UpdateStepInterface;

/**
* Cleanup project for the 3.4.0.
*/
final class Cleanup30400 extends AbstractUpdateStep implements UpdateStepInterface {

/**
* {@inheritdoc}
*/
public function getWeight(): int {
return 10;
}

/**
* {@inheritdoc}
*/
public function update(array &$config): void {
// Update target Ansible version.
if (array_key_exists('ansible', $config)) {
if (array_key_exists('version', $config['ansible'])) {
if ($config['ansible']['version'] === '2.9.*') {
$config['ansible']['version'] = '4.*';
}
}
}

// Ubuntu 20.04 uses 40Gb disk by default.
if (array_key_exists('virtualbox', $config)) {
if (array_key_exists('disk_size', $config['virtualbox'])) {
if ($config['virtualbox']['disk_size'] === '10Gb') {
$config['virtualbox']['disk_size'] = '40Gb';
}
}
}

// Fix broken xdebug configuration.
if (array_key_exists('php_extensions_configuration', $config)) {
if (array_key_exists('xdebug', $config['php_extensions_configuration'])) {
if (array_key_exists('xdebug.discover_client_host', $config['php_extensions_configuration']['xdebug']) &&
$config['php_extensions_configuration']['xdebug']['xdebug.discover_client_host'] === TRUE) {
$config['php_extensions_configuration']['xdebug']['xdebug.discover_client_host'] = 'true';
}
}
}

// Update default value of mysql_sql_mode following update of the
// geerlingguy.mysql (3.3.1 => 3.3.2).
if (array_key_exists('mysql_sql_mode', $config)) {
if ($config['mysql_sql_mode'] === '') {
$config['mysql_sql_mode'] = '~';
}
}
}

}
2 changes: 1 addition & 1 deletion src/Config/Update/UpdateStepInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface UpdateStepInterface extends AbstractStepInterface {
/**
* Contains update step business logic.
*
* @param array[] $config
* @param array<string,mixed> $config
* Draft Environment configuration nested array.
*/
public function update(array &$config): void;
Expand Down

0 comments on commit fe7ee15

Please sign in to comment.