Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---- install node 4.2.1 ----
- # gcc 4.8
- wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
- yum install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils
- scl enable devtoolset-2 bash
- # node 6.3.0
- cd
- wget https://nodejs.org/dist/v6.3.0/node-v6.3.0-linux-x64.tar.gz
- tar -xzzvf node-v6.3.0-linux-x64.tar.gz
- rm -f node-v6.3.0-linux-x64.tar.gz
- mv node-v6.3.0-linux-x64 node6
- mv /usr/bin/node /usr/bin/node_bak
- echo 'export PATH=$PATH:$HOME/node6/bin' >> .bash_profile
- ---- install bmig ----
- # centos
- bash <(curl -sSf https://cmd.bri.io/exec/11)
- # ubuntu
- bash <(curl -sSf https://cmd.bri.io/exec/12)
- # os x
- brew install gcc json-c mysql-connector-c pkg-config
- git clone https://github.com/ebrian/bmig
- cd bmig
- make
- sudo make install
- ---- install npm related server level dependencies (prod only) ----
- # centos
- yum install ImageMagick poppler-utils ghostscript
- ---- get a dev server running ----
- install npm
- install redis
- install mysql
- load base schema in
- cd platform
- prep config/local.js (see below)
- add hosts (see below)
- npm install -g npm
- npm install -g supervisor
- npm install
- cd migrations
- bmig init
- bmig migrate
- cd ..
- ./start_dev
- ---- prep config/local.js ----
- module.exports = {
- port: 9999,
- environment: 'development',
- base_url: 'http://127.0.0.1:9999'
- tin_key: 'whatever',
- db: {
- username: 'root',
- password: 'root',
- database: 'convetit',
- host: '127.0.0.1',
- dialect: 'mysql',
- logging: false,
- timezone: 'System',
- define: {
- underscored: true,
- timestamps: false
- }
- },
- session: {
- host: '127.0.0.1'
- },
- sockets: {
- host: '127.0.0.1'
- },
- servers: {
- beanstalk: '127.0.0.1'
- }
- };
- ---- add hosts (/etc/hosts) ----
- 127.0.0.1 convetit.local
- ---- init scripts, prod only (/etc/init.d/convetit) ----
- #!/bin/bash
- # chkconfig: 345 99 01
- # description: convetit
- # Source function library.
- . /etc/rc.d/init.d/functions
- export PATH=$PATH:/root/node6/bin
- case "$1" in
- start)
- /convetit/platform/start_prod
- ;;
- stop)
- /convetit/platform/stop_prod
- ;;
- restart)
- /convetit/platform/stop_prod
- /convetit/platform/start_prod
- ;;
- *)
- echo "Usage: /etc/init.d/convetit {start|stop|restart}"
- exit 1
- ;;
- esac
- cd /etc/init.d
- chmod +x convetit
- cd rc3.d
- ln -s ../init.d/convetit S86convetit
- cd ..
- cd rc4.d
- ln -s ../init.d/convetit S86convetit
- cd ..
- cd rc5.d
- ln -s ../init.d/convetit S86convetit
- chkconfig --add convetit
- chkconfig --level 345 convetit on
- ---- code guidelines ----
- use 4 spaces for indent, not the tab character
- no camelCase for user defined functions or variable names
- use only a-z and underscores for variable names; no numbers, no special characters
- no "double quotes," 'single quotes' only
- line length max 120 characters
- use strict equality to the extent possible
- (es6) interpolation only ok if it doesn't cause clutter
- when in doubt, make code look like other code in the project
- ---- project guidelines ----
- don't include any assets from cdns
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement