2018-11-04 18:32:08 +02:00
#!/bin/bash
echo "Note: If you use other locale than en_US.UTF-8 , you need to additionally install en_US.UTF-8"
echo " with 'sudo dpkg-reconfigure locales' , so that MongoDB works correctly."
echo " You can still use any other locale as your main locale."
2018-12-24 23:50:43 +02:00
#Below script installs newest node 8.x for Debian/Ubuntu/Mint.
2018-11-04 18:32:08 +02:00
function pause( ) {
read -p " $* "
}
echo
PS3 = 'Please enter your choice: '
2020-06-28 06:42:05 -04:00
options = ( "Install Wekan dependencies" "Build Wekan" "Run Meteor for dev on http://localhost:4000" "Run Meteor for dev on http://CURRENT-IP-ADDRESS:4000" "Run Meteor for dev on http://CUSTOM-IP-ADDRESS:PORT" "Quit" )
2018-11-04 18:32:08 +02:00
select opt in " ${ options [@] } "
do
case $opt in
"Install Wekan dependencies" )
if [ [ " $OSTYPE " = = "linux-gnu" ] ] ; then
2022-01-08 22:15:48 +02:00
echo "Linux" ;
2018-12-24 23:50:43 +02:00
# Debian, Ubuntu, Mint
2021-09-22 13:15:06 +03:00
sudo apt-get install -y build-essential gcc g++ make git curl wget p7zip-full zip unzip unp
2022-01-05 18:56:07 +02:00
#curl -fsSL https://deb.nodesource.com/setup_12.x | sudo -E bash -
#sudo apt-get install -y nodejs
2022-01-10 22:44:17 +02:00
#sudo apt-get install -y npm
# Volta Node and NPM install manager, made with Rust https://volta.sh
# Volta uses home directory also with "npm -g install", no sudo needed.
curl https://get.volta.sh | bash
export VOLTA_HOME = " $HOME /.volta "
export PATH = " $VOLTA_HOME /bin: $PATH "
volta install node@12
2019-07-10 11:56:50 -04:00
# npm nodejs
2020-11-12 16:45:58 +02:00
#curl -0 -L https://npmjs.org/install.sh | sudo sh
#sudo chown -R $(id -u):$(id -g) $HOME/.npm
2022-01-10 22:44:17 +02:00
#sudo npm -g install n
2022-02-23 11:51:56 +02:00
#sudo n 14.19.0
2022-01-10 22:44:17 +02:00
#sudo npm -g install npm
2022-01-08 22:15:48 +02:00
## Latest npm with Meteor 2.2
2022-01-10 22:44:17 +02:00
npm -g install node-gyp
2022-01-08 22:15:48 +02:00
# Latest fibers for Meteor 2.2
2022-01-10 22:44:17 +02:00
#sudo mkdir -p /usr/local/lib/node_modules/fibers/.node-gyp
npm -g install fibers
2022-01-08 22:15:48 +02:00
# Install Meteor, if it's not yet installed
2022-01-10 22:44:17 +02:00
npm install -g meteor --unsafe-perm
2022-01-08 22:15:48 +02:00
#sudo chown -R $(id -u):$(id -g) $HOME/.npm $HOME/.meteor
2018-11-04 18:32:08 +02:00
elif [ [ " $OSTYPE " = = "darwin" * ] ] ; then
echo "macOS" ;
2021-09-22 13:15:06 +03:00
pause '1) Install XCode 2) Install Node 12.x from https://nodejs.org/en/ 3) Press [Enter] key to continue.'
2018-11-04 18:32:08 +02:00
elif [ [ " $OSTYPE " = = "cygwin" ] ] ; then
# POSIX compatibility layer and Linux environment emulation for Windows
echo "TODO: Add Cygwin" ;
exit;
elif [ [ " $OSTYPE " = = "msys" ] ] ; then
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW)
echo "TODO: Add msys on Windows" ;
exit;
elif [ [ " $OSTYPE " = = "win32" ] ] ; then
# I'm not sure this can happen.
echo "TODO: Add Windows" ;
exit;
elif [ [ " $OSTYPE " = = "freebsd" * ] ] ; then
echo "TODO: Add FreeBSD" ;
exit;
else
echo "Unknown"
echo ${ OSTYPE }
exit;
fi
break
; ;
2020-05-12 19:05:51 +03:00
"Build Wekan" )
2018-11-04 18:32:08 +02:00
echo "Building Wekan."
2019-04-20 16:34:16 +03:00
#if [[ "$OSTYPE" == "darwin"* ]]; then
# echo "sed at macOS";
# sed -i '' 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
#else
# echo "sed at ${OSTYPE}"
# sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
#fi
#cd ..
2020-11-12 16:47:12 +02:00
#sudo chown -R $(id -u):$(id -g) $HOME/.npm $HOME/.meteor
2021-02-06 11:13:32 +02:00
rm -rf node_modules .meteor/local .build
chmod u+w *.json
2021-08-11 22:05:17 +03:00
meteor npm install
2020-03-01 22:07:55 +02:00
meteor build .build --directory
2021-08-31 21:54:31 +03:00
rm -rf .build/bundle/programs/web.browser.legacy
2022-02-23 10:30:30 +02:00
( cd .build/bundle/programs/server && rm -rf node_modules && chmod u+w *.json && meteor npm install)
( cd .build/bundle/programs/server/node_modules/fibers && node build.js)
2021-02-06 11:13:32 +02:00
# Cleanup
find . -type d -name '*-garbage*' | xargs rm -rf
find . -name '*phantom*' | xargs rm -rf
find . -name '.*.swp' | xargs rm -f
find . -name '*.swp' | xargs rm -f
# Add fibers multi arch
2021-02-08 18:57:16 +02:00
#cd .build/bundle/programs/server/node_modules/fibers/bin
#curl https://releases.wekan.team/fibers-multi.7z -o fibers-multi.7z
#7z x fibers-multi.7z
#rm fibers-multi.7z
#cd ../../../../../../..
2018-11-04 18:32:08 +02:00
echo Done.
break
; ;
2020-05-12 19:05:51 +03:00
2020-06-28 06:42:05 -04:00
"Run Meteor for dev on http://localhost:4000" )
2022-02-04 12:42:03 +02:00
NODE_OPTIONS = "--max_old_space_size=4096" WITH_API = true RICHER_CARD_COMMENT_EDITOR = false ROOT_URL = http://localhost:4000 meteor run --exclude-archs web.browser.legacy,web.cordova --port 4000
2020-05-12 19:05:51 +03:00
break
; ;
2020-06-28 06:42:05 -04:00
"Run Meteor for dev on http://CURRENT-IP-ADDRESS:4000" )
2020-07-23 11:47:37 +03:00
IPADDRESS = $( ip a | grep 'noprefixroute' | grep 'inet ' | cut -d: -f2 | awk '{ print $2}' | cut -d '/' -f 1)
echo " Your IP address is $IPADDRESS "
2022-02-04 12:42:03 +02:00
NODE_OPTIONS = "--max_old_space_size=4096" WITH_API = true RICHER_CARD_COMMENT_EDITOR = false ROOT_URL = http://$IPADDRESS :4000 meteor run --exclude-archs web.browser.legacy,web.cordova --port 4000
2020-06-28 06:42:05 -04:00
break
; ;
2020-06-24 10:00:53 -04:00
2020-06-28 06:42:05 -04:00
"Run Meteor for dev on http://CUSTOM-IP-ADDRESS:PORT" )
2020-05-12 19:05:51 +03:00
ip address
echo "From above list, what is your IP address?"
read IPADDRESS
echo "On what port you would like to run Wekan?"
read PORT
2020-07-23 11:47:37 +03:00
echo " ROOT_URL=http:// $IPADDRESS : $PORT "
2022-02-04 12:42:03 +02:00
NODE_OPTIONS = "--max_old_space_size=4096" WITH_API = true RICHER_CARD_COMMENT_EDITOR = false ROOT_URL = http://$IPADDRESS :$PORT meteor run --exclude-archs web.browser.legacy,web.cordova --port $PORT
2020-05-12 19:05:51 +03:00
break
2021-07-12 18:16:12 +03:00
; ;
2020-05-12 19:05:51 +03:00
"Quit" )
2018-11-04 18:32:08 +02:00
break
2021-07-12 18:16:12 +03:00
; ;
2020-05-12 19:05:51 +03:00
*) echo invalid option; ;
2018-11-04 18:32:08 +02:00
esac
done