aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/generate_pot.sh22
-rwxr-xr-xscript/load-sample-data10
-rwxr-xr-xscript/rails-post-deploy4
-rwxr-xr-xscript/update-public-body-stats4
4 files changed, 10 insertions, 30 deletions
diff --git a/script/generate_pot.sh b/script/generate_pot.sh
deleted file mode 100755
index c0540c3d9..000000000
--- a/script/generate_pot.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-echo "This is NOT a completed script! Just use it as reference for what to do from the command line, or fix it until it works!"
-exit 1
-
-cd `dirname $0`
-# grab latest po files from Transifex
-tx pull -a -f
-git status | grep app.po | awk '{print $3}' | xargs git add
-git commit -m "Backup latest po files from Transifex"
-
-# now regenerate POT and PO files from Alaveteli source
-bundle exec rake gettext:store_model_attributes
-bundle exec rake gettext:findpot
-
-# upload the result to Transifex
-tx push -t
-
-# re-download (it removes the fuzzy strings and normalises it to the format last committed)
-tx pull -a -f
-git status | grep app.po | awk '{print $3}' | xargs git add
-git commit -m "Updated POT"
diff --git a/script/load-sample-data b/script/load-sample-data
index e91516886..c9e5997f5 100755
--- a/script/load-sample-data
+++ b/script/load-sample-data
@@ -5,22 +5,20 @@
# have a filesystem representation of their contents
export LOC=`dirname "$0"`
-
bundle exec rails runner /dev/stdin <<END
require 'rspec/rails'
-require "#{ENV['LOC']}/../spec/support/load_file_fixtures.rb"
-require "#{ENV['LOC']}/../spec/support/email_helpers.rb"
+require Rails.root.join("spec", "support", "load_file_fixtures")
+require Rails.root.join("spec", "support", "email_helpers")
RSpec.configure do |config|
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
+ config.fixture_path = Rails.root.join("spec","fixtures")
end
# HACK: Normally to load fixtures you'd run `rake db:fixtures:load` but since we
# have .csv files in the fixtures folder Rails tries to load those too. Therefore
# we've pinched some code to load the fixtures:
# https://github.com/rails/rails/blob/v3.1.11/activerecord/lib/active_record/railties/databases.rake#L311
-fixtures_dir = "#{ENV['LOC']}/../spec/fixtures"
-
+fixtures_dir = Rails.root.join("spec","fixtures").to_s
Dir["#{fixtures_dir}/**/*.yml"].each do |fixture_file|
ActiveRecord::Fixtures.create_fixtures(fixtures_dir, fixture_file[(fixtures_dir.size + 1)..-5])
end
diff --git a/script/rails-post-deploy b/script/rails-post-deploy
index 7b31d25be..de950311c 100755
--- a/script/rails-post-deploy
+++ b/script/rails-post-deploy
@@ -85,9 +85,9 @@ then
fi
bundle install $bundle_install_options
-bundle exec rake themes:install
+bundle exec rake submodules:check
# upgrade database
bundle exec rake db:migrate #--trace
-
+bundle exec rake themes:install
diff --git a/script/update-public-body-stats b/script/update-public-body-stats
new file mode 100755
index 000000000..71c2d248c
--- /dev/null
+++ b/script/update-public-body-stats
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+cd `dirname $0`
+bundle exec rake --silent stats:update_public_bodies_stats