Skip to content

Instantly share code, notes, and snippets.

@carlin-q-scott
Created February 9, 2017 14:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carlin-q-scott/7d57cb4684fa28c1823169b53997368c to your computer and use it in GitHub Desktop.
Save carlin-q-scott/7d57cb4684fa28c1823169b53997368c to your computer and use it in GitHub Desktop.
travis-ci build for firefox add-ons
language: node_js
node_js:
- "stable"
env:
global:
- DISPLAY=:99.0
- FIREFOX_BIN=./firefox/firefox
- JPM_FIREFOX_BINARY=./firefox/firefox
before_script:
- bash fetch-firefox.sh release-linux64-add-on-devel
- sh -e /etc/init.d/xvfb start
#!/bin/bash
# Copied and slightly modified from https://github.com/lidel/ipfs-firefox-addon/commit/d656832eec807ebae59543982dde96932ce5bb7c
# Licensed under Creative Commons - CC0 1.0 Universal - https://github.com/lidel/ipfs-firefox-addon/blob/master/LICENSE
BUILD_TYPE=${1:-$FIREFOX_RELEASE}
echo "Looking up latest URL for $BUILD_TYPE"
BUILD_ROOT="/pub/firefox/tinderbox-builds/mozilla-${BUILD_TYPE}/"
ROOT="https://archive.mozilla.org"
LATEST=$(curl -s "$ROOT$BUILD_ROOT" | grep $BUILD_TYPE | grep -Po '<a href=".+">\K[[:digit:]]+' | sort -n | tail -1)
echo "Latest build located at $ROOT$BUILD_ROOT$LATEST"
FILE=$(curl -s "$ROOT$BUILD_ROOT$LATEST/" | grep '.tar.' | grep -Po '<a href="\K[^"]*')
echo "URL: $ROOT$FILE"
wget -O "firefox-${BUILD_TYPE}.tar.bz2" "$ROOT$FILE" && tar xf "firefox-${BUILD_TYPE}.tar.bz2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment