Advertisement
Guest User

Untitled

a guest
Jan 29th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. ---- install node 4.2.1 ----
  2.  
  3. # gcc 4.8
  4. wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
  5. yum install devtoolset-2-gcc devtoolset-2-gcc-c++ devtoolset-2-binutils
  6. scl enable devtoolset-2 bash
  7.  
  8. # node 6.3.0
  9. cd
  10. wget https://nodejs.org/dist/v6.3.0/node-v6.3.0-linux-x64.tar.gz
  11. tar -xzzvf node-v6.3.0-linux-x64.tar.gz
  12. rm -f node-v6.3.0-linux-x64.tar.gz
  13. mv node-v6.3.0-linux-x64 node6
  14. mv /usr/bin/node /usr/bin/node_bak
  15. echo 'export PATH=$PATH:$HOME/node6/bin' >> .bash_profile
  16.  
  17. ---- install bmig ----
  18.  
  19. # centos
  20. bash <(curl -sSf https://cmd.bri.io/exec/11)
  21.  
  22. # ubuntu
  23. bash <(curl -sSf https://cmd.bri.io/exec/12)
  24.  
  25. # os x
  26. brew install gcc json-c mysql-connector-c pkg-config
  27. git clone https://github.com/ebrian/bmig
  28. cd bmig
  29. make
  30. sudo make install
  31.  
  32. ---- install npm related server level dependencies (prod only) ----
  33.  
  34. # centos
  35. yum install ImageMagick poppler-utils ghostscript
  36.  
  37. ---- get a dev server running ----
  38.  
  39. install npm
  40. install redis
  41. install mysql
  42. load base schema in
  43. cd platform
  44. prep config/local.js (see below)
  45. add hosts (see below)
  46. npm install -g npm
  47. npm install -g supervisor
  48. npm install
  49. cd migrations
  50. bmig init
  51. bmig migrate
  52. cd ..
  53. ./start_dev
  54.  
  55. ---- prep config/local.js ----
  56.  
  57. module.exports = {
  58.  
  59. port: 9999,
  60. environment: 'development',
  61. base_url: 'http://127.0.0.1:9999'
  62. tin_key: 'whatever',
  63. db: {
  64. username: 'root',
  65. password: 'root',
  66. database: 'convetit',
  67. host: '127.0.0.1',
  68. dialect: 'mysql',
  69. logging: false,
  70. timezone: 'System',
  71. define: {
  72. underscored: true,
  73. timestamps: false
  74. }
  75. },
  76. session: {
  77. host: '127.0.0.1'
  78. },
  79. sockets: {
  80. host: '127.0.0.1'
  81. },
  82. servers: {
  83. beanstalk: '127.0.0.1'
  84. }
  85.  
  86. };
  87.  
  88. ---- add hosts (/etc/hosts) ----
  89.  
  90. 127.0.0.1 convetit.local
  91.  
  92.  
  93. ---- init scripts, prod only (/etc/init.d/convetit) ----
  94.  
  95. #!/bin/bash
  96.  
  97. # chkconfig: 345 99 01
  98. # description: convetit
  99.  
  100. # Source function library.
  101. . /etc/rc.d/init.d/functions
  102.  
  103. export PATH=$PATH:/root/node6/bin
  104.  
  105. case "$1" in
  106. start)
  107. /convetit/platform/start_prod
  108. ;;
  109. stop)
  110. /convetit/platform/stop_prod
  111. ;;
  112. restart)
  113. /convetit/platform/stop_prod
  114. /convetit/platform/start_prod
  115. ;;
  116. *)
  117. echo "Usage: /etc/init.d/convetit {start|stop|restart}"
  118. exit 1
  119. ;;
  120. esac
  121. cd /etc/init.d
  122. chmod +x convetit
  123. cd rc3.d
  124. ln -s ../init.d/convetit S86convetit
  125. cd ..
  126. cd rc4.d
  127. ln -s ../init.d/convetit S86convetit
  128. cd ..
  129. cd rc5.d
  130. ln -s ../init.d/convetit S86convetit
  131. chkconfig --add convetit
  132. chkconfig --level 345 convetit on
  133.  
  134. ---- code guidelines ----
  135. use 4 spaces for indent, not the tab character
  136. no camelCase for user defined functions or variable names
  137. use only a-z and underscores for variable names; no numbers, no special characters
  138. no "double quotes," 'single quotes' only
  139. line length max 120 characters
  140. use strict equality to the extent possible
  141. (es6) interpolation only ok if it doesn't cause clutter
  142. when in doubt, make code look like other code in the project
  143.  
  144. ---- project guidelines ----
  145. don't include any assets from cdns
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement