2018-12-13 20:27:35 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
|
|
|
BUILD_DEPS="bsdtar gnupg wget curl bzip2 python git ca-certificates perl-Digest-SHA"
|
2019-04-20 14:52:37 +03:00
|
|
|
NODE_VERSION=v8.16.0
|
2018-12-19 19:55:30 +02:00
|
|
|
#METEOR_RELEASE=1.6.0.1 - for Stacksmith, meteor-1.8 branch that could have METEOR@1.8.1-beta.8 or newer
|
2018-12-13 20:27:35 +01:00
|
|
|
USE_EDGE=false
|
|
|
|
METEOR_EDGE=1.5-beta.17
|
|
|
|
NPM_VERSION=latest
|
2019-08-04 13:58:37 +03:00
|
|
|
FIBERS_VERSION=4.0.1
|
2018-12-13 20:27:35 +01:00
|
|
|
ARCHITECTURE=linux-x64
|
2018-12-18 19:42:04 +02:00
|
|
|
#NODE_VERSION=v10.14.1
|
2018-12-13 20:27:35 +01:00
|
|
|
|
2018-12-17 13:09:32 +01:00
|
|
|
sudo yum groupinstall -y 'Development Tools'
|
2018-12-13 20:27:35 +01:00
|
|
|
sudo yum install -y http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm
|
|
|
|
sudo yum install -y git
|
|
|
|
|
|
|
|
sudo useradd --user-group --system --home-dir /home/wekan wekan
|
|
|
|
sudo mkdir -p /home/wekan
|
|
|
|
sudo chown wekan:wekan /home/wekan/
|
|
|
|
|
2019-08-04 13:58:37 +03:00
|
|
|
# master branch that has newer Meteor that is compatible with MongoDB 4.x
|
|
|
|
sudo -u wekan git clone -b master https://github.com/wekan/wekan.git /home/wekan/app
|
2018-12-13 20:27:35 +01:00
|
|
|
|
|
|
|
sudo yum install -y ${BUILD_DEPS}
|
|
|
|
|
|
|
|
# Meteor installer doesn't work with the default tar binary, so using bsdtar while installing.
|
|
|
|
# https://github.com/coreos/bugs/issues/1095#issuecomment-350574389
|
|
|
|
sudo cp $(which tar) $(which tar)~
|
|
|
|
sudo ln -sf $(which bsdtar) $(which tar)
|
|
|
|
|
|
|
|
# Install nodejs
|
|
|
|
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz
|
|
|
|
wget https://nodejs.org/dist/${NODE_VERSION}/SHASUMS256.txt.asc
|
|
|
|
|
|
|
|
grep ${NODE_VERSION}-${ARCHITECTURE}.tar.gz SHASUMS256.txt.asc | shasum -a 256 -c -
|
|
|
|
|
|
|
|
tar xvzf node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz
|
|
|
|
rm node-${NODE_VERSION}-${ARCHITECTURE}.tar.gz
|
|
|
|
sudo mv node-${NODE_VERSION}-${ARCHITECTURE} /opt/nodejs
|
|
|
|
sudo rm -f /usr/bin/node
|
|
|
|
sudo rm -f /usr/bin/npm
|
|
|
|
sudo ln -s /opt/nodejs/bin/node /usr/bin/node || true
|
|
|
|
sudo ln -s /opt/nodejs/bin/npm /usr/bin/npm || true
|
|
|
|
|
|
|
|
sudo npm install -g npm@${NPM_VERSION}
|
|
|
|
sudo npm install -g node-gyp
|
|
|
|
sudo npm install -g --unsafe-perm fibers@${FIBERS_VERSION}
|
|
|
|
|
|
|
|
cd /home/wekan
|
|
|
|
|
|
|
|
#install meteor
|
|
|
|
sudo curl "https://install.meteor.com" -o /home/wekan/install_meteor.sh
|
|
|
|
sudo chmod +x /home/wekan/install_meteor.sh
|
|
|
|
sudo sed -i 's/VERBOSITY="--silent"/VERBOSITY="--progress-bar"/' ./install_meteor.sh
|
2018-12-19 19:55:30 +02:00
|
|
|
echo "Starting installation of "
|
|
|
|
sudo cat /home/wekan/app/.meteor/release
|
|
|
|
echo " ...\n"
|
2018-12-13 20:27:35 +01:00
|
|
|
|
|
|
|
# Check if opting for a release candidate instead of major release
|
|
|
|
if [ "$USE_EDGE" = false ]; then
|
|
|
|
sudo su -c '/home/wekan/install_meteor.sh' - wekan
|
|
|
|
else
|
2019-04-20 14:52:37 +03:00
|
|
|
sudo -u wekan git clone --recursive --depth 1 -b release/METEOR@${METEOR_EDGE} https://github.com/meteor/meteor.git /home/wekan/.meteor;
|
2018-12-13 20:27:35 +01:00
|
|
|
fi;
|
|
|
|
|
|
|
|
sudo sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' /home/wekan/app/packages/meteor-useraccounts-core/package.js
|
|
|
|
sudo -u wekan /home/wekan/.meteor/meteor -- help
|
|
|
|
|
|
|
|
# Build app
|
|
|
|
cd /home/wekan/app
|
|
|
|
meteor=/home/wekan/.meteor/meteor
|
|
|
|
sudo -u wekan ${meteor} add standard-minifier-js
|
|
|
|
sudo -u wekan ${meteor} npm install
|
|
|
|
sudo -u wekan ${meteor} build --directory /home/wekan/app_build
|
|
|
|
sudo cp /home/wekan/app/fix-download-unicode/cfs_access-point.txt /home/wekan/app_build/bundle/programs/server/packages/cfs_access-point.js
|
|
|
|
sudo chown wekan:wekan /home/wekan/app_build/bundle/programs/server/packages/cfs_access-point.js
|
2019-03-06 01:56:32 +02:00
|
|
|
sudo rm /home/wekan/app_build/bundle/programs/server/npm/node_modules/meteor/rajit_bootstrap3-datepicker/lib/bootstrap-datepicker/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
|
2018-12-13 20:27:35 +01:00
|
|
|
cd /home/wekan/app_build/bundle/programs/server/
|
|
|
|
sudo npm install
|
|
|
|
sudo chown -R wekan:wekan ./node_modules
|
|
|
|
sudo mv /home/wekan/app_build/bundle /build
|