diff options
Diffstat (limited to 'script')
-rwxr-xr-x | script/compact-xapian-database | 2 | ||||
-rwxr-xr-x | script/handle-mail-replies.rb | 3 | ||||
-rwxr-xr-x | script/rails-post-deploy | 5 | ||||
-rwxr-xr-x | script/site-specific-install.sh | 5 | ||||
-rwxr-xr-x | script/switch-theme.rb | 31 |
5 files changed, 36 insertions, 10 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database index f1a6058b0..982c0e878 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -4,7 +4,7 @@ export RAILS_ENV=$1 set -e if [ -x /usr/bin/xapian-compact ]; then - XAPIAN_DB_DIR=$( cd "$( dirname "$0" )" && pwd )/../vendor/plugins/acts_as_xapian/xapiandbs + XAPIAN_DB_DIR=$( cd "$( dirname "$0" )" && pwd )/../lib/acts_as_xapian/xapiandbs if [ -e "$XAPIAN_DB_DIR/$RAILS_ENV.new" ]; then echo >&2 "Didn't compact Xapian database because there was an existing database at $XAPIAN_DB_DIR/$RAILS_ENV.new" exit 1 diff --git a/script/handle-mail-replies.rb b/script/handle-mail-replies.rb index da0fc8e96..cbff03acb 100755 --- a/script/handle-mail-replies.rb +++ b/script/handle-mail-replies.rb @@ -20,6 +20,9 @@ $:.push(File.join($alaveteli_dir, "lib", "mail_handler")) load 'configuration.rb' MySociety::Config.set_file(File.join($alaveteli_dir, 'config', 'general'), true) MySociety::Config.load_default + + +require 'active_support/all' require 'mail_handler' if RUBY_VERSION.to_f >= 1.9 # the default encoding for IO is utf-8, and we use utf-8 internally diff --git a/script/rails-post-deploy b/script/rails-post-deploy index c09868347..a88e28b19 100755 --- a/script/rails-post-deploy +++ b/script/rails-post-deploy @@ -96,3 +96,8 @@ bundle exec rake submodules:check bundle exec rake db:migrate #--trace bundle exec rake themes:install + +if [ "$OPTION_STAGING_SITE" = "0" ] +then + bundle exec rake assets:precompile +fi diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh index 8917fd577..7d47a5990 100755 --- a/script/site-specific-install.sh +++ b/script/site-specific-install.sh @@ -66,6 +66,11 @@ ensure_line_present \ /etc/postfix/main.cf 644 ensure_line_present \ + "^ *myhostname *=" \ + "myhostname = $(hostname --fqdn)" \ + /etc/postfix/main.cf 644 + +ensure_line_present \ "^do-not-reply" \ "do-not-reply-to-this-address: :blackhole:" \ /etc/aliases 644 diff --git a/script/switch-theme.rb b/script/switch-theme.rb index 47f81c7a8..980853687 100755 --- a/script/switch-theme.rb +++ b/script/switch-theme.rb @@ -31,6 +31,7 @@ require 'tempfile' +$no_theme_name = 'none' theme_directory = ENV['ALAVETELI_THEMES_DIR'] alaveteli_directory = File.expand_path(File.join(File.dirname(__FILE__), "..")) @@ -53,7 +54,9 @@ $available_themes = Dir.entries(theme_directory).find_all do |local_theme_name| next unless File.directory? full_path next unless File.directory? File.join(full_path, '.git') local_theme_name -end +end.sort + +$available_themes.unshift $no_theme_name if $available_themes.empty? STDERR.puts "There were no theme directories found in '#{theme_directory}'" @@ -62,7 +65,7 @@ end def usage_and_exit STDERR.puts "Usage: #{$0} <THEME-NAME>" - $available_themes.sort.each do |theme_name| + $available_themes.each do |theme_name| STDERR.puts " #{theme_name}" end exit 1 @@ -108,13 +111,23 @@ symlink(File.basename(theme_filename), config_directory, "general.yml") -symlink(File.join(full_theme_path, 'public'), - File.join(alaveteli_directory, 'public'), - 'alavetelitheme') +public_directory = File.join(alaveteli_directory, 'public') -symlink(full_theme_path, - File.join(alaveteli_directory, 'vendor', 'plugins'), - requested_theme) +if requested_theme == $no_theme_name + File.unlink File.join(public_directory, 'alavetelitheme') +else + symlink(File.join(full_theme_path, 'public'), + public_directory, + 'alavetelitheme') + + symlink(full_theme_path, + File.join(alaveteli_directory, 'lib', 'themes'), + requested_theme) +end STDERR.puts """Switched to #{requested_theme}! -You will need to restart any development server you have running.""" +You will need to: + 1. restart any development server you have running. + 2. run: bundle exec rake assets:clean + 3. run: bundle exec rake assets:precompile +""" |