- Ubuntu >= 14.04
- RHEL/CentOS >= 6
-
node['magento']['version']
(string) defaults to 2.1.7 -
node['magento']['edition']
(string) 'Community' or 'Enterprise', defaults to 'Community' -
node['magento']['composer_project']
(string) defaults to 'magento/product-community-edition', should matchnode['magento']['edition']
-
node['magento']['domain']
(string) defaults to 'example.com' -
node['magento']['additional_domains']
(string) any additional domain names -
node['magento']['docroot']
(string) defaults to/var/www/<domain>
-
node['magento']['update_permissions']
(boolean) update Magento file and directory permissions, defaults totrue
-
node['magento']['installation']['verbosity']
(string) verbosity of Composer and Magento install, defaults tovvv
-
node['magento']['installation']['*']
Parameters for Magento installation. A complete list with defaults follows:
['admin_first'] = 'Admin'
['admin_last'] = 'User'
['admin_email'] = 'admin@example.com'
['admin_user'] = 'admin'
['admin_pass'] = 'mage123'
['language'] = 'en_US'
['currency'] = 'USD'
['app_timezone'] = 'America/Los_Angeles'
['backend_frontname'] = 'admin'
['crypt_key'] = ''
['date'] = Time.now.strftime("%a, %d %B %Y %H:%M:%S +0000")
['sample_data'] = false
node['magento']['n98']['enabled']
Defaults totrue
node['magento']['n98']['version']
Version of n98-magerun2 to download, defaults to1.4.0
node['magento']['n98']['checksum']
Checksum for specified versionnode['magento']['n98']['path']
Path to install to, defaults to/usr/local/bin/n98-magerun2
node['magento']['n98']['owner']
Owner, defaults toroot
node['magento']['n98']['group']
Group, defaults toroot
node['magento']['n98']['mode']
Mode, defaults to0755
By design, the default
recipe does nothing. There are two convenience recipes included:
cop_magento::full-install
: Configures environment and installs Magentocop_magento::pre-deploy
: Configures the environment for a pre-generated artifact deployment
Here's an example web
role that will install Magento
name 'web'
description 'install Magento'
override_attributes(
'magento': {
'version': '2.1.2',
'domain': 'example.net',
'docroot': '/var/web/html'
...
}
)
run_list(
'recipe[cop_magento::full-install]'
)
Additionally, a recipe is included that will prepare the environment for deploying a generated artifact. This recipe does not actually install Magento, but creates the directory structure and all dependencies. A CI tool such as CircleCI can then be used to generate a deployable artifact which can be overlayed on this environment.
name 'web'
description 'prep environment for Magento artifact deploy'
override_attributes(
'magento': {
'domain': 'example.net',
}
)
run_list(
'recipe[cop_magento::pre-deploy]'
)
Testing is handled with ServerSpec, via Test Kitchen, which uses Vagrant to spin up VMs.
ServerSpec and Test Kitchen are bundled in the ChefDK package.
Get a listing of your instances with:
$ kitchen list
Run Chef on an instance, in this case default-centos-7, with:
$ kitchen converge default-centos-7
Destroy all instances with:
$ kitchen destroy
Run through and test all the instances in serial by running:
$ kitchen test