forked from swaponline/MultiCurrencyWallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildWordPressPlugin
59 lines (41 loc) · 1.17 KB
/
buildWordPressPlugin
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
#!/bin/sh
git pull
#####WIDGETS
npm run build:mainnet-widget
# update repo or clone
#rm -rf WalletWpPlugin
git clone https://sorentobot:[email protected]/swaponline/WalletWpPlugin.git
cd WalletWpPlugin/vendors/swap
git checkout master
git fetch origin
git reset --hard origin/master
# clean React code from repo
rm -rf assets
rm -rf images
rm -rf fonts
rm -rf *.css
rm -rf *.js
# update files in repo
cp -rf ../../../build-mainnet-widget/* ./
buildId=$(find -iname "app.*?.js" | sed "s/^\.\/app\.\(.*\)\.js$/\1/")
echo $buildId
mv app.${buildId}.js app.js
mv app.${buildId}.css app.css
mv vendor.${buildId}.js vendor.js
rm index.html
rm firebase-messaging-sw.js
rm erc20tokens.js
# https://screenshots.wpmix.net/Telegram_9DNCH0DXYKUiL0Mo1BvVvR7WvDiea0ON.png
rm -rf assets
cd ../../
perl -pi -e "s/'MCWALLET_BUILD_VER', '.*?'/'MCWALLET_BUILD_VER', '${buildId}'/g" multi-currency-wallet-pro.php
perl -i -pe 's/\b(\d+)(?=\D*$)/$1+1/e' multi-currency-wallet-pro.php
# commit build to repo
DATE=`date '+%Y-%m-%d %H:%M:%S'`
git add .
git commit -m "build $DATE"
git push --force
# return back to root
cd ..
sleep 3
wget -qO- https://growup.wpmix.net/wp-content/plugins/github_hook.php