| Line 56... |
Line 56... |
| 56 |
echo "Content generation completed"
|
56 |
echo "Content generation completed"
|
| 57 |
|
57 |
|
| 58 |
echo "Dumping item, vendoritemmapping and vendoritempricing tables to be imported on staging and production servers"
|
58 |
echo "Dumping item, vendoritemmapping and vendoritempricing tables to be imported on staging and production servers"
|
| 59 |
echo "======================================================="
|
59 |
echo "======================================================="
|
| 60 |
cd ${PRGDIR}
|
60 |
cd ${PRGDIR}
|
| - |
|
61 |
|
| - |
|
62 |
a1=$(mysql -uroot -N -pshop2020 catalog -e "SET SESSION group_concat_max_len = 100000;select GROUP_CONCAT(b.id) from ((select a.id from (select * from tmpitem union distinct select * from item) as a group by id having count(a.id) > 1) union (select id from item i1 where not exists (select * from tmpitem t where t.id = i1.id))) as b")
|
| - |
|
63 |
|
| 61 |
mysqldump -uroot -pshop2020 catalog --tables item similaritems source sourceitempricing category voucheritemmapping freebieitem entitytag amazonlisted storepricing brandinfo privatedeals iteminsurermapping > ${MYSQL_DUMP}
|
64 |
mysqldump -uroot -pshop2020 catalog --tables similaritems source sourceitempricing category voucheritemmapping freebieitem entitytag amazonlisted storepricing brandinfo privatedeals iteminsurermapping > ${MYSQL_DUMP}
|
| - |
|
65 |
|
| - |
|
66 |
if [ -z $a1 ]
|
| - |
|
67 |
then
|
| - |
|
68 |
mysqldump -uroot -pshop2020 catalog item --replace --no-create-info --where="id in ($a1)" >> ${MYSQL_DUMP}
|
| - |
|
69 |
else
|
| - |
|
70 |
if [ "$1" == "PROD" ]
|
| - |
|
71 |
then
|
| - |
|
72 |
mysql -uroot -pshop2020 catalog -e "truncate tmpitem;insert into tmpitem AS (SELECT * FROM item)"
|
| - |
|
73 |
else
|
| - |
|
74 |
mysql -uroot -pshop2020 catalog -e "delete from tmpitem where id not in ($a1);insert into tmpitem AS (SELECT * FROM item where id not in ($a1))"
|
| - |
|
75 |
fi
|
| - |
|
76 |
fi
|
| - |
|
77 |
|
| - |
|
78 |
|
| 62 |
|
79 |
|
| 63 |
#get dump for siteContent
|
80 |
#get dump for siteContent
|
| 64 |
mongodump -d CONTENT -c siteContent
|
81 |
mongodump -d CONTENT -c siteContent
|
| 65 |
|
82 |
|
| 66 |
echo "======================================================"
|
83 |
echo "======================================================"
|
| Line 201... |
Line 218... |
| 201 |
ssh ${STAGING_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
218 |
ssh ${STAGING_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
| 202 |
ssh ${STORE_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
219 |
ssh ${STORE_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
| 203 |
ssh ${SUPPORT_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
220 |
ssh ${SUPPORT_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
| 204 |
for PROD_SERVER in ${PROD_SERVERS}
|
221 |
for PROD_SERVER in ${PROD_SERVERS}
|
| 205 |
do
|
222 |
do
|
| 206 |
ssh ${PROD_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
223 |
ssh ${PROD_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp;echo ${a1}>/catalog-dumps/catalog-items"
|
| 207 |
done
|
224 |
done
|
| 208 |
|
225 |
|
| 209 |
for STATIC_SERVER in ${STATIC_SERVERS}
|
226 |
for STATIC_SERVER in ${STATIC_SERVERS}
|
| 210 |
do
|
227 |
do
|
| 211 |
ssh ${STATIC_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|
228 |
ssh ${STATIC_SERVER} "echo ${DATE}>/catalog-dumps/latest.timestamp"
|