Skip to content
This repository was archived by the owner on Oct 1, 2020. It is now read-only.

Commit 44171b2

Browse files
author
Alexander Paliarush
committed
Improved automatic deployment configuration in PHP Storm
1 parent c1bc6e2 commit 44171b2

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

Diff for: init_project.sh

+6-3
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ if [ ! -d ${magento_ce_dir} ]; then
3535
fi
3636
fi
3737

38-
use_nfs=$(bash "${vagrant_dir}/scripts/host/shell/get_variable_value.sh" "guest_use_nfs")
38+
3939
var_generation_dir="${magento_ce_dir}/var/generation"
40-
if [[ ! -d ${var_generation_dir} ]] && [[ ${use_nfs} == 0 ]] ; then
41-
mkdir ${var_generation_dir}
40+
if [ ! -d ${var_generation_dir} ] ; then
41+
host_os=$(bash "${vagrant_dir}/scripts/host/shell/get_host_os.sh")
42+
if [[ ${host_os} == "Windows" || $(bash "${vagrant_dir}/scripts/host/shell/get_variable_value.sh" "guest_use_nfs") == 0 ]]; then
43+
mkdir ${var_generation_dir}
44+
fi
4245
fi
4346

4447
# Update Magento dependencies via Composer

Diff for: scripts/host/php-storm-configs/deployment.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project version="4">
3-
<component name="PublishConfigData">
3+
<component name="PublishConfigData" serverName="<host_name>"<auto_upload_attributes>>
44
<serverData>
55
<paths name="<host_name>">
66
<serverdata>
77
<mappings>
8-
<mapping deploy="$PROJECT_DIR$/magento2ce" local="$PROJECT_DIR$/magento2ce" web="/" />
8+
<mapping deploy="<magento_guest_path>" local="$PROJECT_DIR$/magento2ce" web="/" />
99
</mappings>
10+
<excludedPaths>
11+
<excludedPath local="true" path="$PROJECT_DIR$/magento2ce/app/etc" />
12+
<excludedPath local="true" path="$PROJECT_DIR$/magento2ce/var/generation" />
13+
</excludedPaths>
1014
</serverdata>
1115
</paths>
1216
</serverData>
17+
<auto_upload_option>
1318
</component>
1419
</project>

Diff for: scripts/host/shell/configure_php_storm.sh

+12
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@ cp -R "${vagrant_dir}/scripts/host/php-storm-configs/." "${vagrant_dir}/.idea/"
1414

1515
enabled_virtual_host_config="/etc/apache2/sites-available/magento2.conf"
1616

17+
host_os=$(bash "${vagrant_dir}/scripts/host/shell/get_host_os.sh")
18+
if [[ ${host_os} == "Windows" || $(bash "${vagrant_dir}/scripts/host/shell/get_variable_value.sh" "guest_use_nfs") == 0 ]]; then
19+
sed -i.back "s|<magento_guest_path>|/var/www/magento2ce|g" "${vagrant_dir}/.idea/deployment.xml"
20+
sed -i.back 's|<auto_upload_attributes>| autoUpload="Always" autoUploadExternalChanges="true"|g' "${vagrant_dir}/.idea/deployment.xml"
21+
sed -i.back 's|<auto_upload_option>|<option name="myAutoUpload" value="ALWAYS" />|g' "${vagrant_dir}/.idea/deployment.xml"
22+
else
23+
sed -i.back "s|<magento_guest_path>|\$PROJECT_DIR\$/magento2ce|g" "${vagrant_dir}/.idea/deployment.xml"
24+
sed -i.back 's|<auto_upload_attributes>||g' "${vagrant_dir}/.idea/deployment.xml"
25+
sed -i.back 's|<auto_upload_option>||g' "${vagrant_dir}/.idea/deployment.xml"
26+
fi
27+
1728
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/webServers.xml"
1829
sed -i.back "s|<ssh_port>|${ssh_port}|g" "${vagrant_dir}/.idea/webServers.xml"
1930
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/php.xml"
2031
sed -i.back "s|<ssh_port>|${ssh_port}|g" "${vagrant_dir}/.idea/php.xml"
2132
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/deployment.xml"
33+
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/deployment.xml"
2234
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/.name"
2335
sed -i.back "s|<host_name>|${magento_host_name}|g" "${vagrant_dir}/.idea/modules.xml"
2436
rm -rf ${vagrant_dir}/.idea/*.back
File renamed without changes.

0 commit comments

Comments
 (0)