When you install cakephp3 application for development, you need to do below.
- composer update
- edit app.php
- database migration
- edit config file for web server application (ex. nginx)
This process should be automated and this role is for the automation.
- OS: Ubuntu16.04
- php version is higher than 7.0
- database server is MySql
$ ansible_galaxy install Gnagano.ansible_cakephp3_project_setup --roles-path <your_roles_directory>
Copy defaults/main.yml.default
as defaults/main.yml
and edit main.yml
. The roles variables on main.yml are depends on you. Please read the next section Role Varibles
below.
After editing main.yml, just execute main.yml
The name of what you want to create app
The directory where your new app is installed.
Set version of php_fpm, default value is 7.0
.
The directory path for nginx conf file.
The default value is /etc/nginx/sites-enabled/
.
The file path for nginx conf file.
The default value is /etc/nginx/sites-enabled/default
.
The server name set on nginx conf file.
Additionaly, the routing will be added on /etc/hosts
as 127.0.0.1 {{ cakephp3_nginx_server_name }}
The port used by nginx, default value is 80
.
The name of CAKE_ENV.
The role will be create {{ cakephp3_nginx_conf_dir }}/{{ cakephp3_nginx_default_env_name }}
and {{ cakephp3_nginx_conf_dir }}/{{ cakephp3_nginx_test_env_name }}
as new nginx conf file as the copy of default conf file.
The default values are development
as {{ cakephp3_default_env_name }}
, test
as {{ cakephp3_test_env_name }}
Plese set your app's security_salt which will be added in app.php
Those valiables are for database settings written on config/app.php
As the name of variable, they will be set , host, username, password and database name.
Those variables are for test database.
Those valiables are for email settings. As the name of variable, they will be set hostname, port, address, password.