tools: add preprod2prod script which dump preprod pages for production

This commit is contained in:
Jérôme Schneider 2013-09-12 15:13:09 +02:00
parent 4e099ddd6d
commit 3a1f1903c2
1 changed files with 24 additions and 0 deletions

24
tools/preprod2prod.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/sh
DEST_DIR="/var/tmp/montpellier/fixtures"
if [ ! -d $DEST_DIR ]; then
mkdir -p $DEST_DIR
fi
echo "Building file pages-preprod.json and pages-prod.json in fixtures..."
compte-agglo-montpellier dumpdata sites cms cmsplugin_text_wrapper file \
googlemap link picture snippet teaser video login_plugin data_source_plugin \
a2_service_list_plugin feed_plugin > $DEST_DIR/pages-preprod.json
echo "Changing URLs for prod"
for preprod in $DEST_DIR/*-preprod.json; do
sed -e 's#http://www-test.entrouvert.montpellier-agglo.com#http://www.montpellier-agglo.com#g' \
-e 's#https://idp-test-entrouvert.montpellier-agglo.com#https://compte-citoyen.montpellier-agglo.com#g' \
-e 's#"idp-test-entrouvert.montpellier-agglo.com"#"compte-citoyen.montpellier-agglo.com"#g' \
-e 's#orig=idp-test-entrouvert.montpellier-agglo.com#orig=compte-citoyen.montpellier-agglo.com#g' \
-e 's#https://eservices-test-entrouvert.montpellier-agglo.com#https://eservices.montpellier-agglo.com#g' \
-e 's#passerelle-test-entrouvert.montpellier-agglo.com#passerelle.montpellier-agglo.com#g' \
$preprod >`echo $preprod | sed s,preprod,prod,`; echo " - processed " $preprod
done