Commit 7685870a by Rail Aliiev

Bug 1297519 - Generate multilocale Firefox snaps r=Callek, a=release DONTBUILD

MozReview-Commit-ID: AKkUK91s0Qo

--HG--
extra : source : 4606672d8efe7cc571a8a947edb52b984708cd84
parent 374b72d8
FROM ubuntu:16.04
RUN apt-get update && apt-get install -qy snapcraft bzip2 curl && apt-get clean
DOCKERIO_USERNAME =$(error DOCKERIO_USERNAME should be set)
IMAGE_NAME = firefox-snapcraft
FULL_IMAGE_NAME = $(DOCKERIO_USERNAME)/$(IMAGE_NAME)
build:
docker build -t $(FULL_IMAGE_NAME) --no-cache --rm .
push:
docker push $(FULL_IMAGE_NAME):latest
pull:
docker pull $(FULL_IMAGE_NAME):latest
[Global]
id=mozilla-snap
version=1.0
about=Mozilla Firefox Snap
[Preferences]
app.update.enabled=false
intl.locale.matchOS=true
browser.shell.checkDefaultBrowser=false
#!/bin/sh
set -xe
# Required env variables
test $VERSION
test $BUILD_NUMBER
test $CANDIDATES_DIR
# Optional env variables
: WORKSPACE ${WORKSPACE:=/home/worker/workspace}
: ARTIFACTS_DIR ${ARTIFACTS_DIR:=/home/worker/artifacts}
TARGET="firefox-${VERSION}.snap"
mkdir -p "$ARTIFACTS_DIR"
rm -rf "${WORKSPACE}/source" && mkdir -p "${WORKSPACE}/source/opt" "${WORKSPACE}/source/usr/bin"
CURL="curl --location --retry 10 --retry-delay 10"
# Download and extract en-US linux64 binary
$CURL -o "${WORKSPACE}/firefox.tar.bz2" \
"${CANDIDATES_DIR}/${VERSION}-candidates/build${BUILD_NUMBER}/linux-x86_64/en-US/firefox-${VERSION}.tar.bz2"
tar -C "${WORKSPACE}/source/opt" -xf "${WORKSPACE}/firefox.tar.bz2"
mkdir -p "${WORKSPACE}/source/opt/firefox/distribution/extensions"
cp -v distribution.ini "${WORKSPACE}/source/opt/firefox/distribution/"
# 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"
for locale in $(grep -v ja-JP-mac "${WORKSPACE}/l10n_changesets.txt" | awk '{print $1}'); do
$CURL -o "${WORKSPACE}/source/opt/firefox/distribution/extensions/langpack-${locale}@firefox.mozilla.org.xpi" \
"$CANDIDATES_DIR/${VERSION}-candidates/build${BUILD_NUMBER}/linux-x86_64/xpi/${locale}.xpi"
done
# Symlink firefox binary to /usr/bin to make it available in PATH
ln -s ../../opt/firefox/firefox "${WORKSPACE}/source/usr/bin"
# Generate snapcraft manifest
sed -e "s/@VERSION@/${VERSION}/g" -e "s/@BUILD_NUMBER@/${BUILD_NUMBER}/g" snapcraft.yaml.in > ${WORKSPACE}/snapcraft.yaml
cd ${WORKSPACE}
snapcraft
mv *.snap "$ARTIFACTS_DIR/$TARGET"
cd $ARTIFACTS_DIR
# Generate checksums file
size=$(stat --printf="%s" $ARTIFACTS_DIR/$TARGET)
sha=$(sha512sum $ARTIFACTS_DIR/$TARGET | awk '{print $1}')
echo "$sha sha512 $size $TARGET" > $TARGET.checksums
echo "Generating signing manifest"
hash=$(sha512sum $TARGET.checksums | awk '{print $1}')
cat << EOF > signing_manifest.json
[{"file_to_sign": "$TARGET.checksums", "hash": "$hash"}]
EOF
# For posterity
find . -ls
cat $TARGET.checksums
cat signing_manifest.json
name: firefox
version: @VERSION@-@BUILD_NUMBER@
summary: Mozilla Firefox web browser
description: Firefox is a powerful, extensible web browser with support for modern web application technologies.
confinement: strict
apps:
firefox:
command: desktop-launch firefox
plugs:
- unity7
- network
- home
- x11
- opengl
- pulseaudio
- gsettings
- camera
- browser-sandbox
plugs:
browser-sandbox:
interface: browser-support
allow-sandbox: true
parts:
firefox:
plugin: dump
source: source
stage-packages:
- libxt6
- libdbus-glib-1-2
- libasound2
- libpulse0
- libgl1-mesa-dri
- libgl1-mesa-glx
after: [desktop-gtk3]
---
metadata:
name: "Beet Mover Manifest"
description: "Maps artifact locations to s3 key names for snap iamge"
owner: "release@mozilla.com"
mapping:
all:
snap:
artifact: {{ artifact_base_url }}/firefox-{{ version }}.snap
s3_key: {{ s3_prefix }}snap/firefox-{{ version }}.snap
---
metadata:
name: "Beet Mover Manifest"
description: "Maps artifact locations to s3 key names for snap checksums"
owner: "release@mozilla.com"
mapping:
all:
snap_checksum:
artifact: {{ artifact_base_url }}/firefox-{{ version }}.snap.checksums
s3_key: {{ s3_prefix }}snap/firefox-{{ version }}.snap.checksums
snap_checksum_asc:
artifact: {{ artifact_base_url }}/firefox-{{ version }}.snap.checksums.asc
s3_key: {{ s3_prefix }}snap/firefox-{{ version }}.snap.checksums.asc
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment