setup.sh 920 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. fw_depends rvm nginx
  3. # We assume single-user installation as
  4. # done in our rvm.sh script and
  5. # in Travis-CI
  6. if [ "$TRAVIS" = "true" ]
  7. then
  8. rvmsudo rvm install ruby-2.0.0-p0
  9. else
  10. rvm install ruby-2.0.0-p0
  11. fi
  12. sed -i 's|CWD|'"${TROOT}"'|g' nginx.conf
  13. sed -i 's|DBHOSTNAME|'"${DBHOST}"'|g' nginx.conf
  14. rvm use ruby-2.0.0-p0
  15. RETCODE=$(fw_exists ${IROOT}/nginx_mruby.installed)
  16. [ "$RETCODE" == 0 ] || { \
  17. git clone git://github.com/matsumoto-r/ngx_mruby.git
  18. cd ngx_mruby
  19. git submodule init
  20. git submodule update
  21. [ -d mruby/mrbgems/mruby-mysql ] || git clone git://github.com/mattn/mruby-mysql.git mruby/mrbgems/mruby-mysql
  22. NGINX_CONFIG_OPT_ENV="--prefix=${IROOT}/nginx_mruby --with-http_stub_status_module" sh build.sh
  23. make install
  24. echo -e "export PATH=${IROOT}/nginx_mruby/sbin:\$PATH" > $IROOT/nginx_mruby.installed
  25. }
  26. source $IROOT/nginx_mruby.installed
  27. nginx -c $TROOT/nginx.conf &