forked from frappe/frappe
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheasy_install.sh
More file actions
98 lines (75 loc) · 3.21 KB
/
Copy patheasy_install.sh
File metadata and controls
98 lines (75 loc) · 3.21 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
echo "Updating apt..."
apt-get update
echo "Installing dependencies..."
apt-get install -y python3-minimal build-essential python3-setuptools wget python3-pip python3-venv git build-essential python3-setuptools python3-dev libffi-dev redis-server python3-pil libjpeg-dev zlib1g-dev nginx supervisor
echo "Installing mariadb..."
apt-get install -y mariadb-server
# Set the root password
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY '*WebWorks"'!'"'; FLUSH PRIVILEGES;"
echo "
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4" >> /etc/mysql/my.cnf
service mysql restart
echo "Creating barako user..."
adduser barako
usermod -aG sudo barako
echo "barako ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "export PATH=\$PATH:/home/barako/.local/bin" >> /home/barako/.bashrc
echo '
echo "Installing node..."
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 14
nvm use 14
npm install -g yarn
echo "Installing bench/frappe..."
pip3 install frappe-bench
bench init --frappe-path https://bitbucket.org/denim-apps/frappe frappe
echo "Succesfully installed Frappe (SERVIO fork)!"
echo ""
echo "Run \"./setup-site.sh <domain> [--erpnext]\" to set up the first site."
echo "For example \"./setup-site.sh erpnext.denimtool.com --erpnext\"."
' > /home/barako/install.sh
chmod a+x /home/barako/install.sh
echo '
[ -z "$#" ] && echo "To use this command:
./setup-site.sh <site-domain>
To include ERPNext in the installation:
./setup-site.sh <site-domain> --erpnext
For example:
./setup-site.sh erpnext.denimtool.com --erpnext" && exit
if [ "$2" = "--erpnext" ] ; then
cd frappe/ &&
bench get-app https://bitbucket.org/denim-apps/lemonade-erpnext/ --branch develop &&
bench new-site --mariadb-root-password="*WebWorks"'!' --install-app="erpnext" $1
else
cd frappe/ &&
bench new-site --mariadb-root-password="*WebWorks"'!' $1
fi
bench setup supervisor
sudo ln ./config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
sudo supervisorctl reload
bench setup nginx
sudo ln ./config/nginx.conf /etc/nginx/conf.d/frappe.conf
sudo service nginx restart
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --nginx
' > /home/barako/setup-site.sh
chmod a+x /home/barako/setup-site.sh
echo "If you haven't yet set up a swap file for this system, you may want to by running \"./makeswap.sh\""
echo '
fallocate -l 1G /swapfile && dd if=/dev/zero of=/swapfile bs=1024 count=1048576 && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile && (echo "/swapfile swap swap defaults 0 0" >> /etc/fstab) && swapon --show && free -h
' > ./makeswap.sh
chmod a+x ./makeswap.sh
echo ""
echo "To complete the next steps, run \"su - barako\" and, while logged in as the barako user, run \"./install.sh\""
echo "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
nvm install 14" > /home/barako/install-node.sh