On Github wdalmut / mageday2014
Mainly for Service Oriented Architecture
it is easier create and destroy environments than upgrade them
All environment variables are ported to your application in $_SERVER
You can pass everything like: Memcached and Mysql configurations etc.
Create a folder in your project root with name .ebextensions and append your configuration files with extension .config
ElasticBeanstalk will use them during the application provisioning
.ebextensions/05_cron_jobs.config
container_commands:
01_magento_cron_job:
command: "cat .ebextensions/magento_cron_job.txt > /etc/cron.d/magento_cron_job && chmod 644 /etc/cron.d/magento_cron_job"
leader_only: true
All configuration files are just simple YAML files
You can monitor many metrics with CloudWatch
UDP/IP CloudWatch agent on local machine: https://github.com/wdalmut/cloudwatch-agent
commands:
21_application_logs:
command: echo "/var/app/current/var/log/*.log" > myapp.conf
cwd: /opt/elasticbeanstalk/tasks/bundlelogs.d
22_application_logs:
command: echo "/var/app/current/var/log/*.log" > myapp.conf
cwd: /opt/elasticbeanstalk/tasks/systemtaillogs.d
23_application_logs:
command: echo "/var/app/current/var/log/*.log" > myapp.conf
cwd: /opt/elasticbeanstalk/tasks/taillogs.d
24_application_logs:
command: echo "/var/app/current/var/log/*.log" > myapp.conf
cwd: /opt/elasticbeanstalk/tasks/publishlogs.d
.ebextensions/06_prepare_logs.config
ElasticBeanstalk uses Composer in order to prepare your application
So, we can use composer hooks in order to connect all env variables to our Magento configuration
http://github.com/magento-hackathon/magento-composer-installer
{
/** other composer configs **/
"scripts": {
"post-update-cmd": [
"Corley\\Deploy\\Magento::localConf"
],
"post-install-cmd": [
"Corley\\Deploy\\Magento::localConf"
]
},
}
<?php
namespace Corley\Deploy;
use Composer\Script\Event;
class Magento
{
public static function localConf(Event $event)
{
// Generate a local.xml based on environment variables
}
}
ok but, what could we use?