Bug 1444898 - Snap: Use dedicated snap docker image instead of the Ubuntu one r=rail a=release
authorJohan Lorenzo <jlorenzo@mozilla.com>
Mon, 12 Mar 2018 15:23:32 +0100
changeset 462700 79248272d2901be36f74a075775ac5fcf6eae566
parent 462699 7475744281cba0b57d9bae726937907bd57ea766
child 462701 be52d88a3808a7bb7149fb4d63109bb80be9df00
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrail, release
bugs1444898
milestone60.0
Bug 1444898 - Snap: Use dedicated snap docker image instead of the Ubuntu one r=rail a=release MozReview-Commit-ID: 2wDKUHJI9tr
taskcluster/ci/docker-image/kind.yml
taskcluster/ci/release-snap/kind.yml
taskcluster/docker/firefox-snap/Dockerfile
taskcluster/docker/firefox-snap/runme.sh
--- a/taskcluster/ci/docker-image/kind.yml
+++ b/taskcluster/ci/docker-image/kind.yml
@@ -93,8 +93,10 @@ jobs:
   beet-mover:
     symbol: I(bm)
   update-verify:
     symbol: I(uv)
   diffoscope:
     symbol: I(diff)
   periodic-updates:
     symbol: I(file)
+  firefox-snap:
+    symbol: I(snap)
--- a/taskcluster/ci/release-snap/kind.yml
+++ b/taskcluster/ci/release-snap/kind.yml
@@ -26,27 +26,25 @@ job-defaults:
       platform: linux64/opt
       kind: build
       tier: 3
    worker-type: aws-provisioner-v1/gecko-{level}-b-linux
    worker:
       implementation: docker-worker
       os: linux
       max-run-time: 7200
-      docker-image: mozillareleases/firefox-snapcraft@sha256:107cc7a89d45ce6df30f44fe0dfd0b375b3ab443b75e92efc77c4f7bc5da8717
+      docker-image: {in-tree: firefox-snap}
       artifacts:
          - name: public/build
            type: directory
            path: /home/worker/artifacts/
       command:
          - /bin/bash
          - -cx
          - >
-           apt-get update &&
-           apt-get dist-upgrade -y &&
            curl -o scripts.tar.bz2 {config_params[head_repository]}/archive/{config_params[head_rev]}.tar.bz2/taskcluster/docker/firefox-snap/ &&
            mkdir scripts &&
            tar xvfj scripts.tar.bz2 -C scripts --strip-components 4 &&
            cd scripts &&
            ./runme.sh
       env:
          VERSION: "{release_config[version]}"
          BUILD_NUMBER: "{release_config[build_number]}"
--- a/taskcluster/docker/firefox-snap/Dockerfile
+++ b/taskcluster/docker/firefox-snap/Dockerfile
@@ -1,3 +1,6 @@
-FROM ubuntu:16.04
+FROM snapcore/snapcraft:stable
 
-RUN apt-get update && apt-get install -qy snapcraft bzip2 curl git && apt-get clean
+RUN apt-get update && apt-get install -qy python3 bzip2 curl git && apt-get clean
+
+# Set a default command useful for debugging
+CMD ["/bin/bash", "--login"]
--- a/taskcluster/docker/firefox-snap/runme.sh
+++ b/taskcluster/docker/firefox-snap/runme.sh
@@ -53,16 +53,19 @@ for i in *.deb; do
     # shellcheck disable=SC2086
     dpkg-deb --fsys-tarfile $i | tar xv -C "$SOURCE_DEST" --wildcards "./usr/share/locale-langpack/*/LC_MESSAGES/gtk30.mo" || true
 done
 
 # Generate snapcraft manifest
 sed -e "s/@VERSION@/${VERSION}/g" -e "s/@BUILD_NUMBER@/${BUILD_NUMBER}/g" snapcraft.yaml.in > "${WORKSPACE}/snapcraft.yaml"
 cp -v "$SCRIPT_DIRECTORY/mimeapps.list" "$WORKSPACE"
 cd "${WORKSPACE}"
+
+# Make sure snapcraft knows we're building amd64, even though we may not be on this arch.
+export SNAP_ARCH='amd64'
 snapcraft
 
 mv -- *.snap "$TARGET_FULL_PATH"
 
 cd "$ARTIFACTS_DIR"
 
 # Generate checksums file
 size=$(stat --printf="%s" "$TARGET_FULL_PATH")