Skip to content

Instantly share code, notes, and snippets.

@aaj013
Last active December 20, 2018 08:38
Show Gist options
  • Save aaj013/1409b58557dfeed734b175ec7bfbc2a8 to your computer and use it in GitHub Desktop.
Save aaj013/1409b58557dfeed734b175ec7bfbc2a8 to your computer and use it in GitHub Desktop.
install-tasking-manager-deb9.sh
#---
#Install Script of Tasking-Manager on Debian 9 (Stretch)
#The script is referred from (https://github.com/hotosm/tasking-manager/wiki/Client-Install-Script-for-Ubuntu-16.04) with minor changes for Debian 9. The following commands can be copy / pasted into the fresh Debian 9 installation and it will end with a locally running version of the Tasking Manager 3 client application.
#---
sudo apt-get update &&
sudo apt-get -y upgrade &&
# Install Python 3.6.5 by building from source
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev &&
sudo apt-get install -y libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm &&
sudo apt-get install -y libncurses5-dev libncursesw5-dev xz-utils tk-dev &&
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz &&
tar -xJf Python-3.6.5.tar.xz &&
cd Python-3.6.5 &&
./configure --enable-optimizations &&
make -j8 &&
sudo make install &&
cd .. &&
#Install NodeJS
sudo apt-get -y install curl &&
curl -sL https://deb.nodesource.com/setup_6.x > install-node6.sh &&
sudo chmod +x install-node6.sh &&
sudo ./install-node6.sh &&
sudo apt-get -y install nodejs &&
#Install gulp
sudo npm install gulp -g &&
npm i browser-sync --save &&
#Install postgresql-9.6
sudo apt-get -y install postgresql-9.6 &&
sudo apt-get -y install libpq-dev &&
sudo apt-get -y install postgresql-server-dev-9.6 &&
#Install dependencies
sudo apt-get -y install libxml2 &&
sudo apt-get -y install libxml2-dev &&
sudo apt-get -y install libgeos-3.5.1 &&
sudo apt-get -y install libgeos-dev &&
sudo apt-get -y install libproj12 &&
sudo apt-get -y install libproj-dev &&
sudo apt-get -y install libgdal-dev &&
sudo apt-get -y install libjson-c-dev &&
#Install postgis 2.4.5
wget https://postgis.net/stuff/postgis-2.4.5dev.tar.gz &&
tar -xvzf postgis-2.4.5dev.tar.gz &&
cd postgis-2.4.5dev &&
./configure &&
make &&
sudo make install &&
cd .. &&
#Cloning tasking-manager and building
sudo apt-get -y install git &&
git clone --recursive https://github.com/hotosm/tasking-manager.git &&
cd tasking-manager/ &&
python3.6 -m venv ./venv &&
#If error popups regarding venv, install python3.6-venv
. ./venv/bin/activate &&
pip install --upgrade pip &&
pip install -r requirements.txt &&
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p &&
sudo -u postgres psql -c `CREATE ROLE hottm LOGIN PASSWORD 'hottm';` &&
sudo -u postgres createdb -T template0 tasking-manager -E UTF8 -O hottm &&
sudo -u postgres psql -d tasking-manager -c `CREATE EXTENSION postgis;` &&
export TM_DB="postgresql://hottm:hottm@localhost/tasking-manager" &&
export TM_CONSUMER_KEY="VLm4AmuigZODSZQSEEdarv8LhFi4NFodc9JbvvEl" &&
export TM_CONSUMER_SECRET="hkS6CwbTJjpwPeIuVJemj4Y5H2WoXYYpiSUBVlhO" &&
export TM_ENV="Dev" &&
export TM_SECRET="45dfHJJ456dRh378gGFergeqrgtDFGerterRte" &&
./venv/bin/python3.6 manage.py db upgrade &&
cd client/ &&
npm install &&
gulp build &&
cd ../ &&
venv/bin/python manage.py runserver -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment