2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-09 08:30:39 +00:00

Added nodejs and npm in install

This commit is contained in:
Anand Doshi 2015-08-17 12:05:16 +05:30
parent 568350c02c
commit e23a2fb389

48
install_scripts/setup_frappe.sh Normal file → Executable file
View File

@ -17,11 +17,11 @@ get_passwd() {
set_opts () { set_opts () {
OPTS=`getopt -o v --long verbose,mysql-root-password:,frappe-user:,bench-branch:,setup-production,skip-setup-bench,help -n 'parse-options' -- "$@"` OPTS=`getopt -o v --long verbose,mysql-root-password:,frappe-user:,bench-branch:,setup-production,skip-setup-bench,help -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS" eval set -- "$OPTS"
VERBOSE=false VERBOSE=false
HELP=false HELP=false
FRAPPE_USER=false FRAPPE_USER=false
@ -40,7 +40,7 @@ set_opts () {
echo "MSQ_PASS=$MSQ_PASS" >> ~/frappe_passwords.sh echo "MSQ_PASS=$MSQ_PASS" >> ~/frappe_passwords.sh
echo "ADMIN_PASS=$ADMIN_PASS" >> ~/frappe_passwords.sh echo "ADMIN_PASS=$ADMIN_PASS" >> ~/frappe_passwords.sh
fi fi
while true; do while true; do
case "$1" in case "$1" in
-v | --verbose ) VERBOSE=true; shift ;; -v | --verbose ) VERBOSE=true; shift ;;
@ -57,7 +57,7 @@ set_opts () {
} }
get_distro() { get_distro() {
ARCH=$(uname -m | sed 's/x86_/amd/;s/i[3-6]86/x86/') ARCH=$(uname -m | sed 's/x86_/amd/;s/i[3-6]86/x86/')
if [ $ARCH == "amd64" ]; then if [ $ARCH == "amd64" ]; then
T_ARCH="x86_64" T_ARCH="x86_64"
@ -65,7 +65,7 @@ get_distro() {
else else
T_ARCH="i386" T_ARCH="i386"
WK_ARCH="i386" WK_ARCH="i386"
fi fi
if [ -f /etc/redhat-release ]; then if [ -f /etc/redhat-release ]; then
OS="centos" OS="centos"
@ -87,7 +87,7 @@ get_distro() {
export ARCH=$ARCH export ARCH=$ARCH
export T_ARCH=$T_ARCH export T_ARCH=$T_ARCH
export WK_ARCH=$WK_ARCH export WK_ARCH=$WK_ARCH
echo Installing for $OS $OS_VER $ARCH echo Installing for $OS $OS_VER $ARCH
echo "In case you encounter an error, you can post on https://discuss.frappe.io" echo "In case you encounter an error, you can post on https://discuss.frappe.io"
echo echo
} }
@ -96,7 +96,7 @@ run_cmd() {
if $VERBOSE; then if $VERBOSE; then
"$@" "$@"
else else
# $@ # $@
"$@" > /tmp/cmdoutput.txt 2>&1 || (cat /tmp/cmdoutput.txt && exit 1) "$@" > /tmp/cmdoutput.txt 2>&1 || (cat /tmp/cmdoutput.txt && exit 1)
fi fi
} }
@ -112,7 +112,7 @@ gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1 gpgcheck=1
" > /etc/yum.repos.d/mariadb.repo " > /etc/yum.repos.d/mariadb.repo
} }
add_ubuntu_mariadb_repo() { add_ubuntu_mariadb_repo() {
run_cmd sudo apt-get update run_cmd sudo apt-get update
@ -124,7 +124,7 @@ add_ubuntu_mariadb_repo() {
add_debian_mariadb_repo() { add_debian_mariadb_repo() {
if [ $OS_VER == "7" ]; then if [ $OS_VER == "7" ]; then
CODENAME="wheezy" CODENAME="wheezy"
elif [ $OS_VER == "6" ]; then elif [ $OS_VER == "6" ]; then
CODENAME="squeeze" CODENAME="squeeze"
else else
@ -157,12 +157,12 @@ add_maria_db_repo() {
elif [ "$OS" == "centos" ]; then elif [ "$OS" == "centos" ]; then
echo Adding centos mariadb repo echo Adding centos mariadb repo
add_centos6_mariadb_repo add_centos6_mariadb_repo
elif [ "$OS" == "debian" ]; then elif [ "$OS" == "debian" ]; then
echo Adding debian mariadb repo echo Adding debian mariadb repo
add_debian_mariadb_repo add_debian_mariadb_repo
elif [ "$OS" == "Ubuntu" ]; then elif [ "$OS" == "Ubuntu" ]; then
echo Adding ubuntu mariadb repo echo Adding ubuntu mariadb repo
add_ubuntu_mariadb_repo add_ubuntu_mariadb_repo
else else
@ -171,29 +171,31 @@ add_maria_db_repo() {
fi fi
} }
## install ## install
install_packages() { install_packages() {
if [ $OS == "centos" ]; then if [ $OS == "centos" ]; then
run_cmd sudo yum install wget -y run_cmd sudo yum install wget -y
run_cmd sudo yum groupinstall -y "Development tools" run_cmd sudo yum groupinstall -y "Development tools"
if [ $OS_VER == "6" ]; then if [ $OS_VER == "6" ]; then
run_cmd add_ius_repo run_cmd add_ius_repo
run_cmd sudo yum install -y git MariaDB-server MariaDB-client MariaDB-compat python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python27-devel python27 libxml2 libxml2-devel libxslt libxslt-devel redis MariaDB-devel libXrender libXext python27-setuptools cronie sudo which xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi run_cmd sudo yum install -y git MariaDB-server MariaDB-client MariaDB-compat python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python27-devel python27 libxml2 libxml2-devel libxslt libxslt-devel redis MariaDB-devel libXrender libXext python27-setuptools cronie sudo which xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi nodejs npm
elif [ $OS_VER == "7" ]; then elif [ $OS_VER == "7" ]; then
run_cmd add_epel_centos7 run_cmd add_epel_centos7
run_cmd sudo yum install -y git mariadb-server mariadb-devel python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python-devel libxml2 libxml2-devel libxslt libxslt-devel redis libXrender libXext supervisor cronie sudo which xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 run_cmd sudo yum install -y git mariadb-server mariadb-devel python-setuptools nginx zlib-devel bzip2-devel openssl-devel postfix python-devel libxml2 libxml2-devel libxslt libxslt-devel redis libXrender libXext supervisor cronie sudo which xorg-x11-fonts-75dpi xorg-x11-fonts-Type1 nodejs npm
fi fi
echo "Installing wkhtmltopdf" echo "Installing wkhtmltopdf"
install_wkhtmltopdf_centos install_wkhtmltopdf_centos
run_cmd easy_install-2.7 -U pip run_cmd easy_install-2.7 -U pip
elif [ $OS == "debian" ] || [ $OS == "Ubuntu" ]; then elif [ $OS == "debian" ] || [ $OS == "Ubuntu" ]; then
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
setup_debconf setup_debconf
run_cmd sudo apt-get update run_cmd sudo apt-get update
run_cmd sudo apt-get install python-dev python-setuptools build-essential python-mysqldb git ntp nodejs npm vim screen htop mariadb-server mariadb-common libmariadbclient-dev libxslt1.1 libxslt1-dev redis-server libssl-dev libcrypto++-dev postfix nginx supervisor python-pip fontconfig libxrender1 libxext6 xfonts-75dpi xfonts-base -y run_cmd sudo apt-get install -y python-dev python-setuptools build-essential python-mysqldb git ntp vim screen htop mariadb-server mariadb-common libmariadbclient-dev libxslt1.1 libxslt1-dev redis-server libssl-dev libcrypto++-dev postfix nginx supervisor python-pip fontconfig libxrender1 libxext6 xfonts-75dpi xfonts-base nodejs npm
echo "Installing wkhtmltopdf" echo "Installing wkhtmltopdf"
install_wkhtmltopdf_deb install_wkhtmltopdf_deb
@ -326,7 +328,7 @@ default-character-set = utf8mb4
run_cmd sudo systemctl restart mysql run_cmd sudo systemctl restart mysql
fi fi
elif [ $OS == "debian" ] || [ $OS == "Ubuntu" ]; then elif [ $OS == "debian" ] || [ $OS == "Ubuntu" ]; then
echo "$config" > $deb_cnf_path echo "$config" > $deb_cnf_path
sudo service mysql restart sudo service mysql restart
fi fi
@ -364,7 +366,7 @@ setup_bench() {
FRAPPE_BRANCH="master" FRAPPE_BRANCH="master"
ERPNEXT_APPS_JSON="https://raw.githubusercontent.com/frappe/bench/master/install_scripts/erpnext-apps-master.json" ERPNEXT_APPS_JSON="https://raw.githubusercontent.com/frappe/bench/master/install_scripts/erpnext-apps-master.json"
fi fi
run_cmd sudo su $FRAPPE_USER -c "cd /home/$FRAPPE_USER && bench init frappe-bench --frappe-branch $FRAPPE_BRANCH --apps_path $ERPNEXT_APPS_JSON" run_cmd sudo su $FRAPPE_USER -c "cd /home/$FRAPPE_USER && bench init frappe-bench --frappe-branch $FRAPPE_BRANCH --apps_path $ERPNEXT_APPS_JSON"
echo Setting up first site echo Setting up first site
echo /home/$FRAPPE_USER/frappe-bench > /etc/frappe_bench_dir echo /home/$FRAPPE_USER/frappe-bench > /etc/frappe_bench_dir