diff options
author | Sarah Mei <sarahmei@gmail.com> | 2011-01-10 05:29:43 +0300 |
---|---|---|
committer | Sarah Mei <sarahmei@gmail.com> | 2011-01-10 05:29:43 +0300 |
commit | b865c20b2d62703c719d712549165369f0f2db87 (patch) | |
tree | 803b9321049fd51978711d5824ea772863e43a3d /script | |
parent | e09771d9b440c14302c3ad265ee7c12afc936d48 (diff) |
Backing out sub-uri changes
Diffstat (limited to 'script')
-rwxr-xr-x | script/get_env.sh | 26 | ||||
-rwxr-xr-x | script/server | 17 |
2 files changed, 4 insertions, 39 deletions
diff --git a/script/get_env.sh b/script/get_env.sh deleted file mode 100755 index 83c4e0e4a..000000000 --- a/script/get_env.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# Get value from AppConfig -# -# Usage get_env [key ...] - -path=$( readlink -fn $0) && cd $(dirname $path)/.. || exit 2 - -size=0 -size=$( wc tmp/environment 2>/dev/null | awk '{print $1}') || : -if [[ "$size" = "0" || tmp/environment -ot config/app_config.yml ]] -then - ruby > tmp/environment << 'EOT' - require File.join('config', 'environment.rb') - AppConfig.config_vars.each { |key, value| - puts key.to_s + "\t" + value.to_s - } - puts "pod_uri.host\t" + AppConfig[:pod_uri].host.to_s - puts "pod_uri.path\t" + AppConfig[:pod_uri].path.to_s - puts "pod_uri.port\t" + AppConfig[:pod_uri].port.to_s -EOT -fi - -for key in $@; do - awk -v key=$key '{ if ($1 == key ) print $2 }' < tmp/environment -done diff --git a/script/server b/script/server index 1a00d5f38..bfc4b5380 100755 --- a/script/server +++ b/script/server @@ -9,22 +9,12 @@ OS=`uname -s` [ -e config/server.sh ] && source config/server.sh -function init_suburi_assets -# fix a symlink corresponding to sub-uri -{ - find public -maxdepth 1 -type l -delete - sub_uri=$(./script/get_env.sh pod_uri.path) - if [ -n "$sub_uri" -a "$sub_uri" != "/" ]; then - cd public; ln -sf . ${sub_uri##/}; cd .. - fi -} - function init_public # Create all dynamically generated files in public/ folder { bundle exec thin \ - -d --pid log/thin.pid --address localhost --port $THIN_PORT \ - start + -d --pid log/thin.pid --address localhost --port $THIN_PORT \ + start for ((i = 0; i < 30; i += 1)) do sleep 2 wget -q -O tmp/server.html http://localhost:$THIN_PORT && \ @@ -117,6 +107,8 @@ if [ -n "$services" ]; then exit 64 fi + + # Check if Mongo is running if ! ps ax | grep -v grep | grep mongod >/dev/null then @@ -157,7 +149,6 @@ if [ ! -e 'public/stylesheets/application.css' ]; then exit 66 fi -[ -w public ] && init_suburi_assets mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& |