Git based wiki inspired by Gollum
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.0KB

  1. #!/bin/bash
  2. # Provision script created for Ubuntu 14.04
  3. APP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  4. if [ -d "/vagrant" ]; then
  5. # Control will enter here if $DIRECTORY exists.
  6. APP_DIR="/vagrant"
  7. fi
  8. echo "Provisioning..."
  9. if ! type "add-apt-repository" > /dev/null; then
  10. sudo apt-get update
  11. sudo apt-get install -y software-properties-common python-software-properties
  12. fi
  13. # Elastic Search
  14. # wget -qO - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | sudo apt-key add -
  15. # echo 'deb http://packages.elasticsearch.org/elasticsearch/1.4/debian stable main' | sudo tee /etc/apt/sources.list.d/elastic.list
  16. sudo add-apt-repository -y ppa:chris-lea/node.js
  17. sudo apt-get update
  18. sudo apt-get install -y python build-essential pkg-config git \
  19. python-pip python-virtualenv python-dev zlib1g-dev libldap2-dev libsasl2-dev \
  20. libffi-dev libyaml-dev libssl-dev libldap2-dev libsasl2-dev nodejs
  21. # Create swap file because ES eats up RAM and 14.04 doesn't have swap by default
  22. sudo fallocate -l 1G /swapfile
  23. sudo chmod 600 /swapfile
  24. sudo mkswap /swapfile
  25. sudo swapon /swapfile
  26. sudo su -c "echo '/swapfile none swap sw 0 0' >> /etc/fstab"
  27. # lxml deps
  28. # libxml2-dev libxslt1-dev
  29. # Default cache is memoization
  30. # Redis
  31. # add-apt-repository -y chris-lea/redis-server
  32. # add-apt-repository -y chris-lea/python-redis
  33. # apt-get update
  34. # apt-get install -y redis-server
  35. # Default DB is sqlite
  36. # Mysql
  37. # apt-get install -y mysql-server mysql-client
  38. # MariaDB
  39. # apt-get install -y mariadb-server mariadb-client
  40. # Postgres
  41. # apt-get install -y postgresql postgresql-contrib
  42. # Install frontend assets
  43. sudo npm install -g bower
  44. cd /home/vagrant
  45. virtualenv .venv
  46. source .venv/bin/activate
  47. cd /vagrant
  48. bower --config.interactive=false install
  49. pip install -r requirements.txt
  50. echo "Installing start scripts"
  51. cat << EOF > /tmp/realms-wiki
  52. #!/bin/bash
  53. /home/vagrant/.venv/bin/realms-wiki "\$@"
  54. EOF
  55. sudo mv /tmp/realms-wiki /usr/local/bin
  56. sudo chmod +x /usr/local/bin/realms-wiki
  57. realms-wiki start