aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-02-09 13:21:56 +0000
committerSeb Bacon <seb.bacon@gmail.com>2012-02-09 13:21:56 +0000
commit308707f1512fc43c570023ee786463d37e43f1fb (patch)
treeea7ebdaaf9988a8adfa91b8ff2b496a92a6624f9 /script
parentb1a683778e817005751ac08654d17366d4cda624 (diff)
parent46646f8e659dc3c567495424088eb66e6ef2feee (diff)
Merge branch 'release/0.5.1'
Conflicts: README.md
Diffstat (limited to 'script')
-rwxr-xr-xscript/generate_pot.sh16
-rwxr-xr-xscript/rails-post-deploy53
2 files changed, 51 insertions, 18 deletions
diff --git a/script/generate_pot.sh b/script/generate_pot.sh
index 0c5dfda36..f6c82dda7 100755
--- a/script/generate_pot.sh
+++ b/script/generate_pot.sh
@@ -1,8 +1,22 @@
#!/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
rake gettext:store_model_attributes
rake gettext:findpot
-echo "Now commit the new app.pot and push. See TRANSLATE.md for next steps" \ No newline at end of file
+# 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/rails-post-deploy b/script/rails-post-deploy
index 263d5d926..d9e9bb3f1 100755
--- a/script/rails-post-deploy
+++ b/script/rails-post-deploy
@@ -22,42 +22,61 @@ cd app/..
# read config file in for later (STAGING_SITE)
if [ -e "config/general" ] || [ -e "config/general.yml" ]
then
- . commonlib/shlib/deployfns
- read_conf config/general
+ . commonlib/shlib/deployfns
+ read_conf config/general
else
- OPTION_DOMAIN=127.0.0.1:3000
- OPTION_STAGING_SITE=1
+ OPTION_DOMAIN=127.0.0.1:3000
+ OPTION_STAGING_SITE=1
fi
# create initial log files
if [ -e $APP_DIR/../logs ]
then
- # mySociety servers have logs dir in level above
- rm -f log
- ln -s $APP_DIR/../logs log
+ # mySociety servers have logs dir in level above
+ rm -f log
+ ln -s $APP_DIR/../logs log
else
- # otherwise just make the directory
- if [ -h log ]
- then
- # remove any old-style symlink first
- rm -f log
- fi
- mkdir -p log
+ # otherwise just make the directory
+ if [ -h log ]
+ then
+ # remove any old-style symlink first
+ rm -f log
+ fi
+ mkdir -p log
fi
# link the "downloads" directory in the cache to somewhere it can be served
if [ ! -e $APP_DIR/public/download ]
then
- mkdir -p $APP_DIR/cache/zips/download
- ln -s $APP_DIR/cache/zips/download $APP_DIR/public/
+ mkdir -p $APP_DIR/cache/zips/download
+ ln -s $APP_DIR/cache/zips/download $APP_DIR/public/
fi
cd log
touch development.log fastcgi.crash.log production.log test.log
cd ..
+# Force appropriate environment in production
+if [ "$OPTION_STAGING_SITE" = "0" ]
+then
+ cat <<-END
+
+ *****************************************************************
+ WARNING: About to make config/rails_env.rb which, via special
+ code in config/boot.rb, forces the Rails environment to be
+ "production". If this is a development system, please edit your
+ config/general.yml file and set the STAGING_SITE option to 1,
+ and also delete the generated config/rails_env.rb file.
+ Alternatively, you can override config/rails_env.rb at any time
+ with an environment variable.
+ *****************************************************************
+
+ END
+ echo "ENV['RAILS_ENV'] ||= 'production'" > config/rails_env.rb
+fi
+
if [ -n "$OPTION_THEME_URL" ]
then
- script/plugin install --force $OPTION_THEME_URL
+ script/plugin install --force $OPTION_THEME_URL
fi
# upgrade database