This repository was archived by the owner on Oct 1, 2020. It is now read-only.
File tree 3 files changed +6
-1
lines changed
3 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 26
26
config_data = Config . load
27
27
magento_host_name = config_data [ 'magento' ] [ 'host_name' ]
28
28
magento_ip_address = config_data [ 'guest' ] [ 'ip_address' ]
29
+ forwarded_ssh_port = config_data [ 'guest' ] [ 'forwarded_ssh_port' ]
29
30
guest_memory = config_data [ 'guest' ] [ 'memory' ]
30
31
31
32
# NFS will be used for *nix and OSX hosts, if not disabled explicitly in config
@@ -87,5 +88,7 @@ Vagrant.configure(VAGRANT_API_VERSION) do |config|
87
88
config . vm . define magento_host_name do |node |
88
89
node . vm . hostname = magento_host_name
89
90
node . vm . network :private_network , ip : magento_ip_address
91
+ node . vm . network :forwarded_port , guest : 22 , host : forwarded_ssh_port
90
92
end
93
+ config . ssh . guest_port = forwarded_ssh_port
91
94
end
Original file line number Diff line number Diff line change @@ -15,8 +15,10 @@ if [ ! -f "${vagrant_dir}/local.config/config.yaml" ]; then
15
15
cp " ${config_path} .dist" ${config_path}
16
16
fi
17
17
random_ip=$(( ( RANDOM % 240 ) + 12 ))
18
+ forwarded_ssh_port=$(( random_ip + 3000 ))
18
19
sed -i.back " s|ip_address: \" 192.168.10.2\" |ip_address: \" 192.168.10.${random_ip} \" |g" " ${config_path} "
19
20
sed -i.back " s|host_name: \" magento2.vagrant2\" |host_name: \" magento2.vagrant${random_ip} \" |g" " ${config_path} "
21
+ sed -i.back " s|forwarded_ssh_port: 3000|forwarded_ssh_port: ${forwarded_ssh_port} |g" " ${config_path} "
20
22
rm -f " ${config_path} .back"
21
23
22
24
# Clean up the project before initialization if "-f" option was specified
@@ -44,7 +46,6 @@ if [ ! -d ${magento_ce_dir} ]; then
44
46
fi
45
47
fi
46
48
47
-
48
49
var_generation_dir=" ${magento_ce_dir} /var/generation"
49
50
if [ ! -d ${var_generation_dir} ] ; then
50
51
host_os=$( bash " ${vagrant_dir} /scripts/host/shell/get_host_os.sh" )
Original file line number Diff line number Diff line change 7
7
# Default is 2Gb, around 3Gb is necessary to run functional tests
8
8
memory: 2048
9
9
ip_address: "192.168.10.2"
10
+ forwarded_ssh_port: 3000
10
11
environment:
11
12
# If set to 0, PHP 5 will be installed
12
13
use_php7: 1
You can’t perform that action at this time.
0 commit comments