system-config/modules/jenkins_slave/files/slave_scripts/propose_translations.sh
Monty Taylor 17b2bda1a0 Added slave scripts to puppet.
Added all of the files from slave_scripts to jenkins_slave.
Includes the changes I submitted in https://review.openstack.org/6063
Changed the jobs to use these rather than the ones from openstack-ci.

Change-Id: I4bd9e78b3d9c0cbbc6a0b17fc95c60458b06a0f7
2012-04-02 13:52:57 -07:00

33 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -xe
git config user.name "OpenStack Jenkins"
git config user.email "jenkins@openstack.org"
# See if there is an open change in the launchpad/translations topic
# If so, amend the commit with new changes since then
previous=`ssh -p 29418 review.openstack.org gerrit query --current-patch-set status:open project:openstack/PROJECT topic:launchpad/translations | grep "^ number:" | awk '{print $2}'`
if [ "x${previous}" != "x" ] ; then
git review -d ${previous}
amend="--amend"
fi
tar xvfz po.tgz
rm po.tgz
for f in po/*po ; do
lang=`echo $f | cut -f2 -d/ | cut -f1 -d.`
if [ -d $PROJECT/locale/$lang ] ; then
cp $f $PROJECT/locale/$lang/LC_MESSAGES/$PROJECT.po
fi
done
python setup.py extract_messages
git add $PROJECT/locale/$PROJECT.pot
python setup.py update_catalog
for f in po/*po ; do
lang=`echo $f | cut -f2 -d/ | cut -f1 -d.`
if [ -d $PROJECT/locale/$lang ] ; then
git add $PROJECT/locale/$lang/LC_MESSAGES/$PROJECT.po
fi
done
git commit ${amend} -m "Imported Translations from Launchpad"
git review -t launchpad/translations