Bug 1432417 - Fetch l10n_changesets from tree r=sfraser

MozReview-Commit-ID: FEyb6hmJXmf

--HG--
extra : rebase_source : 29294a5e9cc0c2b513391826d7ab8249e6e12f41
This commit is contained in:
Johan Lorenzo 2018-01-23 11:17:49 +01:00
Родитель f77417e3e0
Коммит 3354095c95
3 изменённых файлов: 18 добавлений и 5 удалений

Просмотреть файл

@ -65,6 +65,7 @@ job-defaults:
https://net-mozaws-prod-delivery-firefox.s3.amazonaws.com/pub/{task[shipping-product]}/candidates
LC_ALL: C.UTF-8
LANG: C.UTF-8
L10N_CHANGESETS: "{config_params[head_repository]}/raw-file/{config_params[head_rev]}/browser/locales/l10n-changesets.json"
taskcluster-proxy: true
notifications:
completed:

Просмотреть файл

@ -0,0 +1,11 @@
#!/usr/bin/env python3
import sys
import json
l10n_changesets_json_path = sys.argv[1]
with open(l10n_changesets_json_path) as f:
locales = json.load(f).keys()
linux_locales = [l for l in locales if l != 'ja-JP-mac']
print('\n'.join(sorted(linux_locales)))

Просмотреть файл

@ -6,6 +6,7 @@ set -xe
test $VERSION
test $BUILD_NUMBER
test $CANDIDATES_DIR
test $L10N_CHANGESETS
# Optional env variables
: WORKSPACE ${WORKSPACE:=/home/worker/workspace}
@ -35,12 +36,12 @@ DISTRIBUTION_DIR="$SOURCE_DEST/distribution"
mv "$PARTNER_CONFIG_DIR/desktop/ubuntu/distribution" "$DISTRIBUTION_DIR"
cp -v "$SCRIPT_DIRECTORY/firefox.desktop" "$DISTRIBUTION_DIR"
# Use release-specific list of locales to fetch L10N XPIs
$CURL -o "${WORKSPACE}/l10n_changesets.txt" "${CANDIDATES_DIR}/${VERSION}-candidates/build${BUILD_NUMBER}/l10n_changesets.txt"
cat "${WORKSPACE}/l10n_changesets.txt"
# Use list of locales to fetch L10N XPIs
$CURL -o "${WORKSPACE}/l10n_changesets.json" "$L10N_CHANGESETS"
locales=$(python3 "$SCRIPT_DIRECTORY/extract_locales_from_l10n_json.py" "${WORKSPACE}/l10n_changesets.json")
mkdir -p "$DISTRIBUTION_DIR/extensions"
for locale in $(grep -v ja-JP-mac "${WORKSPACE}/l10n_changesets.txt" | awk '{print $1}'); do
for locale in $locales; do
$CURL -o "$SOURCE_DEST/distribution/extensions/langpack-${locale}@firefox.mozilla.org.xpi" \
"$CANDIDATES_DIR/${VERSION}-candidates/build${BUILD_NUMBER}/linux-x86_64/xpi/${locale}.xpi"
done
@ -79,7 +80,7 @@ cat signing_manifest.json
# TODO: Make this part an independent task
if [ "$PUSH_TO_CHANNEL" != "" ]; then
echo "Beta version detected. Uploading to Ubuntu Store (no channel)..."
bash "$SCRIPT_DIRECTORY/fetch_macaroons.sh" 'http://taskcluster/secrets/v1/secret/project/releng/snapcraft/firefox/$PUSH_TO_CHANNEL'
bash "$SCRIPT_DIRECTORY/fetch_macaroons.sh" "http://taskcluster/secrets/v1/secret/project/releng/snapcraft/firefox/$PUSH_TO_CHANNEL"
snapcraft push "$TARGET_FULL_PATH"
else
echo "Non-beta version detected. Nothing else to do."