Advertisement
huutho_96

Untitled

Dec 27th, 2018
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.92 KB | None | 0 0
  1.  
  2. apt-get update -y
  3.  
  4. apt-get install nfs-common -y
  5. ifconfig eth1 up
  6. # != 192.168.0.1
  7. ip addr add 192.168.0.2/24 dev eth1
  8. mkdir /mnt/share
  9. mount 192.168.0.1:/opt/share /mnt/share
  10.  
  11.  
  12. # install require package
  13. apt-get update -y
  14. apt-get install build-essential checkinstall -y
  15. apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
  16.  
  17. # download and install Python 3.5.2
  18. cd /usr/src
  19. wget "https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz"
  20. tar xzf Python-3.5.2.tgz
  21.  
  22. cd /usr/src/Python-3.5.2
  23. ./configure
  24. make altinstall
  25. python3.5 -V
  26. pip3.5 -V
  27.  
  28.  
  29. # Install git
  30. apt-get install git -y
  31.  
  32. # Install node
  33. apt-get update
  34. apt-get install curl software-properties-common -y
  35. curl -sL https://deb.nodesource.com/setup_10.x | bash -
  36. apt-get install -y nodejs
  37. node -v
  38.  
  39. # Install pm2
  40. npm install pm2 -g
  41. pm2 list
  42.  
  43. # chown ubuntu:ubuntu /home/ubuntu/.pm2/rpc.sock /home/ubuntu/.pm2/pub.sock
  44.  
  45. # Init git hook
  46. mkdir /var/code
  47. mkdir /var/code/medusa_slave.git -p
  48. mkdir /var/code/medusa_slave_src -p
  49. cd /var/code/medusa_slave.git
  50. git init --bare
  51.  
  52. touch /var/code/medusa_slave.git/hooks/post-receive
  53. chmod 755 /var/code/medusa_slave.git/hooks/post-receive
  54.  
  55. echo "#!/bin/bash" >> /var/code/medusa_slave.git/hooks/post-receive
  56. echo "echo 'post-receive: Triggered.'" >> /var/code/medusa_slave.git/hooks/post-receive
  57. echo "echo 'post-receive: git check out…'" >> /var/code/medusa_slave.git/hooks/post-receive
  58. echo "git --git-dir=/var/code/medusa_slave.git --work-tree=/var/code/medusa_slave_src checkout deploy-crawler -f" >> /var/code/medusa_slave.git/hooks/post-receive
  59. echo "echo 'post-receive: install project…'" >> /var/code/medusa_slave.git/hooks/post-receive
  60. echo "cd /var/code/medusa_slave_src/Crawler && pip3.5 install --user -r requirement.txt && pm2 start slave.py --interpreter=python3.5 --name=Slave" >> /var/code/medusa_slave.git/hooks/post-receive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement