-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcustom-magento-github.sh
More file actions
65 lines (35 loc) · 2.3 KB
/
custom-magento-github.sh
File metadata and controls
65 lines (35 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
YOUR_GIT_REPOSETORY="https://github.com/magento/magento2"
MAGE_DOMAIN=$(curl ipinfo.io/ip)
cd /var/www/html/magento/
git clone $YOUR_GIT_REPOSETORY . #replace with your git hub url
git config core.fileMode false
git config --global credential.helper store
composer install # use instal if you are having Lock file or Update if without
# wget http://s3.example.com/production_dump.sql.gz
# mysql -u root -e 'create database magento2;'
# sed 's/\sDEFINER=`[^`]*`@`[^`]*`//g' -i ../production_dump.sql
# mysql -u root magento2 < ./production_dump.sql.gz
# zcat ./production_dump.sql.gz | mysql -u root magento2
# rm /production_dump.sql.gz
# select * from core_config_data where path regexp ".*base.*url.*";
# change magento configurations
# for HTTPS
# mysql -u root magento2 -e 'UPDATE core_config_data set value = "0" where path like "%web/secure/use_in%"'
# mysql -u root magento2 -e "UPDATE core_config_data set value = \"http://$MAGE_DOMAIN/\" where path like \"%base_url%\""
# mysql -u root magento2 -e "UPDATE core_config_data set value = \"http://$MAGE_DOMAIN/\" where path like \"%web/unsecure/base_link_url%\""
# for Https
# mysql -u root magento2 -e 'UPDATE core_config_data set value = "1" where path like "%web/secure/use_in%"'
# mysql -u root magento2 -e "UPDATE core_config_data set value = \"https://$MAGE_DOMAIN/\" where path like \"%base_url%\""
# mysql -u root magento2 -e "UPDATE core_config_data set value = \"https://$MAGE_DOMAIN/\" where path like \"%web/unsecure/base_link_url%\""
# UPDATE core_config_data set value = "http://3.133.89.177/static/" where path like "%web/unsecure/base_static%";
# UPDATE core_config_data set value = "http://18.221.109.71/" where path like "%base_url%";
# UPDATE core_config_data set value = "0" where path like "%web/secure/use_in%"
# UPDATE core_config_data set value = REPLACE(value, 'https:', 'http:') WHERE value LIKE 'https://%.com/%';
# UPDATE core_config_data set value = "0" where path like "%web/secure/enable_upgrade_insecure%";
rm -rf ./app/env.php
# copy production images to S3
# aws s3 cp /{magento_dir}/pub/media/ s3://{your-s3media-bucked}/ --recursive --exclude "*cache*"
# copy from s 3 to current server
# aws s3 cp s3://{your-s3media-bucked}/ /{magento_dir}/pub/media/ --recursive --exclude "*cache*"
bash ./install-magento.sh