Fix ZUUL_REFNAME for translation jobs

Pass in the branch in upstream_translation for Zuul v3 and use it
instead of ZUUL_REFNAME.

Change-Id: Ib2f7aa49dec1ff906e1fef7e32bdbc4d3146e369
This commit is contained in:
Andreas Jaeger 2017-10-17 17:51:34 +02:00 committed by Andreas Jaeger
parent ec7d8347ba
commit ccf36ea678
2 changed files with 10 additions and 3 deletions

View File

@ -17,12 +17,19 @@ JOBNAME=$2
# Replace /'s in branch names with -'s because Zanata doesn't
# allow /'s in version names.
ZANATA_VERSION=${ZUUL_REFNAME//\//-}
# Zuul v3 native job passes the branch in as parameter but
# does not set ZUUL_REFNAME.
if [ -z "$ZUUL_REFNAME" ] ; then
BRANCHNAME=$3
else
BRANCHNAME=$ZUUL_REFNAME
fi
ZANATA_VERSION=${BRANCHNAME//\//-}
SCRIPTSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPTSDIR/common_translation_update.sh
init_branch $ZUUL_REFNAME
init_branch $BRANCHNAME
# List of all modules to copy POT files from
ALL_MODULES=""

View File

@ -6,7 +6,7 @@
tasks:
- name: Run upstream_translation_update.sh script
command: "{{ ansible_user_dir }}/scripts/upstream_translation_update.sh {{ zuul.project.short_name }} {{ zuul.job }}"
command: "{{ ansible_user_dir }}/scripts/upstream_translation_update.sh {{ zuul.project.short_name }} {{ zuul.job }} {{zuul.branch}}"
args:
chdir: "src/{{ zuul.project.canonical_name }}"