-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprovision.sh
116 lines (98 loc) · 3.79 KB
/
provision.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env bash
# Turn off iptables.
service iptables stop
service ip6tables stop
chkconfig iptables off
chkconfig ip6tables off
# Install utilities.
yum -y install vim nano git screen tree
# Install Node.js v4.2.4.
curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
yum -y install nodejs
# Install Nginx.
cp /vagrant/config/nginx/nginx.repo /etc/yum.repos.d/nginx.repo
yum -y install nginx
cp /vagrant/config/nginx/nginx.conf /etc/nginx/nginx.conf
service nginx start
chkconfig nginx on
# Install MongoDB.
cp /vagrant/config/mongodb/mongodb-org-3.2.repo /etc/yum.repos.d/mongodb-org-3.2.repo
yum install -y mongodb-org
cp /vagrant/config/mongodb/mongod.conf /etc/mongod.conf
cp /vagrant/config/mongodb/99-mongodb-nproc.conf /etc/security/limits.d/99-mongodb-nproc.conf
service mongod start
chkconfig mongod on
# Install ntp.
yum install -y ntp
service ntpd start
chkconfig ntpd on
# Add EPEL repo.
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install bash auto-completions.
yum install -y bash-completion
# Install beanstalkd.
yum -y install beanstalkd
cp /vagrant/config/beanstalkd.conf /etc/sysconfig/beanstalkd
service beanstalkd start
chkconfig beanstalkd on
# Install redis.
yum -y install redis
cp /vagrant/config/redis.conf /etc/redis.conf
service redis start
chkconfig redis on
# Install supervisord.
yum -y install python-pip supervisor
yum -y remove supervisor
pip install supervisor --pre
cp /vagrant/config/supervisord/supervisord.init /etc/init.d/supervisord
chmod 755 /etc/init.d/supervisord
cp /vagrant/config/supervisord/supervisord.conf /etc/supervisord.conf
mkdir -p /etc/supervisord/conf.d
mkdir -p /var/log/supervisor
service supervisord start
chkconfig supervisord on
# Upgrade PIP
pip install --upgrade pip
# Install bower and nodemon.
npm install -g bower nodemon
# Custom vim setup.
mkdir -p /home/vagrant/.vim/autoload /home/vagrant/.vim/bundle /home/vagrant/.vim/colors
mkdir -p /root/.vim/autoload /root/.vim/colors
curl -LSso /home/vagrant/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
curl -LSso /root/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
cp /vagrant/config/vim/vimrc /home/vagrant/.vimrc
cp /vagrant/config/vim/vimrc /root/.vimrc
cp /vagrant/config/vim/TomorrowNightEighties.vim /home/vagrant/.vim/colors/
cp /vagrant/config/vim/TomorrowNightEighties.vim /root/.vim/colors/
# Install vim plugins.
cd /home/vagrant/.vim/bundle/
git clone https://github.com/scrooloose/nerdtree.git
git clone https://github.com/spf13/PIV.git
git clone https://github.com/ctrlpvim/ctrlp.vim.git
git clone https://github.com/msanders/snipmate.vim.git
git clone https://github.com/scrooloose/nerdcommenter.git
git clone https://github.com/Raimondi/delimitMate.git
git clone https://github.com/Shougo/neocomplcache.vim.git
git clone https://github.com/Shougo/neosnippet.vim.git
git clone https://github.com/Shougo/neosnippet-snippets.git
git clone https://github.com/scrooloose/syntastic.git
git clone https://github.com/spf13/vim-autoclose.git
git clone https://github.com/terryma/vim-multiple-cursors.git
git clone https://github.com/tpope/vim-vinegar.git
cd /root
cp -R /home/vagrant/.vim/bundle /root/.vim/bundle
chown -R vagrant:vagrant /home/vagrant/.vimrc /home/vagrant/.vim
# Custom bashrc.
cp /vagrant/config/bash/vagrant.bashrc /home/vagrant/.bashrc
chown vagrant:vagrant /home/vagrant/.bashrc
cp /vagrant/config/bash/root.bashrc /root/.bashrc
# Add custom bash profile.
cp /vagrant/config/bash/vagrant.bash_profile /home/vagrant/.bash_profile
chown vagrant:vagrant /home/vagrant/.bash_profile
# TODO : Before packaging up the box, SSH into the VM and run these commands:
#sudo yum clean all
#sudo dd if=/dev/zero of=/bigemptyfile bs=1M
#sudo rm -rf /bigemptyfile
#sudo su
#history -c && exit
#cat /dev/null > ~/.bash_history && history -c && exit