-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·64 lines (58 loc) · 1.99 KB
/
setup.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
###########################
# FCMS SETUP INSTRUCTIONS #
###########################
apt-get install build-essential
apt-get install openssh-server
apt-get install apache2 # serveur web
apt-get install mysql-server libmysqlclient-dev # pour gem mysql2
apt-get install libxml2-dev libxslt1-dev # pour gem nokogiri
apt-get install git
########################
# RVM AND RUBY INSTALL #
########################
apt-get install curl
curl -L https://get.rvm.io | bash -s stable
rvm requirements
rvm install 1.9.3
rvm use 1.9.3 --default
rvm rubygems current
chown -R root:rvm /usr/local/rvm # des fois les permissions sucks
adduser fcms # creer un user fcms
usermod -a -G rvm fcms # ajouter le user fcms au groupe rvm
su fcms
echo 'export RAILS_ENV=production' >> ~/.bashrc # toujours etre en mode production
#############################
# PHUSION PASSENGER INSTALL #
#############################
apt-get install libcurl4-openssl-dev apache2-threaded-dev libapr1-dev libaprutil1-dev
gem install passenger
passenger-install-apache2-module
########################################
# SETUP GIT BRANCH AND DATABASE CONFIG #
########################################
# DEVELOP BRANCH
mkdir develop
cd develop
git init
git remote add -t develop -f origin [email protected]:Inovitex/fcms.git
git checkout develop
bundle install
git update-index --assume-unchanged config/database.yml
# DB
mysql -u root -p
CREATE DATABASE fcms_develop;
GRANT ALL ON fcms_develop.* TO fcms_develop@localhost IDENTIFIED BY '2eC#uWaH6D9u';
vi config/database.yml # update to the new database config
# PRODUCTION BRANCH
mkdir production
cd production
git init
git remote add -t master -f origin [email protected]:Inovitex/fcms.git
git checkout master
bundle install
git update-index --assume-unchanged config/database.yml
# DB
mysql -u root -p
CREATE DATABASE fcms_production;
GRANT ALL ON fcms_production.* TO fcms_production@localhost IDENTIFIED BY '8&g9vaBe@!b2';
vi config/database.yml # update to the new database config