Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added DB port and DB user host settings #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/config/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ project.environment.install.alowed=local
# Configuration Files
#------------------------------------------------------------------------------------------
magento.config.filename=config/mg2-builder/magento/config.yaml
servers.config.filename=config/mg2-builder/servers/config.yaml
servers.config.filename=config/mg2-builder/server/config.yaml
template.envphp=config/mg2-builder/magento/env.php.template
template.integration.mysql=config/mg2-builder/magento/install-config-mysql.php.template
template.apache.local=config/mg2-builder/vhost/apache.local.conf
Expand Down Expand Up @@ -38,6 +38,7 @@ sync.media.excludes=--exclude='cache' --exclude='js' --exclude='css' --exclude='
#------------------------------------------------------------------------------------------
database.host=localhost
database.connection.type=default
database.port=3306
setup.upgrade.keep.generated=1

#------------------------------------------------------------------------------------------
Expand Down
17 changes: 13 additions & 4 deletions build/xmlscripts/database.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,16 @@
</then>
</if>

<property name="database.connection.command" value="mysql -h${database.host} -u${database.admin.username}"/>
<if>
<not>
<isset property="database.user.host"/>
</not>
<then>
<property name="database.user.host" value="${database.host}"/>
</then>
</if>

<property name="database.connection.command" value="mysql -h${database.host} -u${database.admin.username} -P${database.port}"/>
<if>
<not>
<equals arg1="${database.admin.password}" arg2=""/>
Expand All @@ -59,9 +68,9 @@
logskipped="true">

<exec command="${database.connection.command} -e '
DROP USER IF EXISTS `${database.user}`@`${database.host}`;
CREATE USER IF NOT EXISTS `${database.user}`@`${database.host}` IDENTIFIED BY &quot;${database.password}&quot;;
GRANT ALL ON *.* TO `${database.user}`@`${database.host}`;'"
DROP USER IF EXISTS `${database.user}`@`${database.user.host}`;
CREATE USER IF NOT EXISTS `${database.user}`@`${database.user.host}` IDENTIFIED BY &quot;${database.password}&quot;;
GRANT ALL ON *.* TO `${database.user}`@`${database.user.host}`;'"
checkreturn="true"
logoutput="true"/>

Expand Down
1 change: 1 addition & 0 deletions build/xmlscripts/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<replacetokens begintoken="{{" endtoken="}}">
<token key="ENCRYPTION_KEY" value="${encryption.key}"/>
<token key="DATABASE_HOST" value="${database.host}"/>
<token key="DATABASE_PORT" value="${database.port}"/>
<token key="DATABASE_USER" value="${database.user}"/>
<token key="DATABASE_PASS" value="${database.password}"/>
<token key="DATABASE_NAME" value="${database.name}"/>
Expand Down
2 changes: 1 addition & 1 deletion build/xmlscripts/magento.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<property name="command.magento.install" value="${bin.n98-magerun2} setup:install" />
<property name="params.command.magento.install"
value="--backend-frontname=&quot;${magento.admin.frontname}&quot;
--db-host=&quot;${database.host}&quot;
--db-host=&quot;${database.host}:${database.port}&quot;
--db-name=&quot;${database.name}&quot;
--db-user=&quot;${database.user}&quot;
--db-password=&quot;${database.password}&quot;
Expand Down
2 changes: 1 addition & 1 deletion config.sample/mg2-builder/magento/env.php.template
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ return array (
array (
'default' =>
array (
'host' => '{{DATABASE_HOST}}',
'host' => '{{DATABASE_HOST}}:{{DATABASE_PORT}}',
'dbname' => '{{DATABASE_NAME}}',
'username' => '{{DATABASE_USER}}',
'password' => '{{DATABASE_PASS}}',
Expand Down