Last active
April 11, 2016 17:16
-
-
Save hophacker/d3642d067d56e5edbc9bd6792a77c96a to your computer and use it in GitHub Desktop.
Revisions
-
Jie Feng renamed this gist
Apr 11, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Jie Feng created this gist
Apr 11, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ #!/bin/bash - set -o nounset # Treat unset variables as an error port=3002 search=false RAILS_ENV=${RAILS_ENV:-development} while getopts p:e:rw:s opt do case "$opt" in p) port=$OPTARG ;; s) search=true ;; [?]) echo -e >&2 "Usage: \n\t-e [environment: default development | production] \n\t-p [port: default 80]" exit 1 ;; esac done if [ $search = true ]; then bundle exec rake sunspot:solr:start bundle exec rake sunspot:solr:reindex fi export ROOT_URL=${ROOT_URL:-http://trainwith.cn/} if [ $RAILS_ENV = "development" ]; then export BAIDU_MAP_API_KEY="v9cvM6PLGPhfoeQA35b5dsVu" elif [ $RAILS_ENV = "production" ]; then export BAIDU_MAP_API_KEY="eD9GHzQcS2Zl1QPtGRDikPW5" fi export QINIU_DOMAIN="http://7xpmg1.com1.z0.glb.clouddn.com" export SECRET_KEY_BASE=$(openssl rand -hex 64) rails s -b 0.0.0.0 -p $port