Skip to content

Commit

Permalink
Build and upload Chrome extensions as build artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
nickstenning committed Jan 13, 2016
1 parent 2a0c72e commit a39c494
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# use Travis container build infrastructure
sudo: false
addons:
artifacts:
paths:
# Upload all built zipfiles (browser extensions)
- $(ls build/*.zip | tr "\n" ":")
postgresql: "9.4"
language:
- python
Expand All @@ -17,15 +21,8 @@ before_script:
script:
# Run all tests, with coverage if possible
- make cover
# Test building browser extensions
- hypothesis-buildext conf/testext.ini chrome --base http://localhost
- hypothesis-buildext conf/testext.ini firefox --base http://localhost
- "hypothesis-buildext conf/production.ini chrome
--base https://hypothes.is
--assets chrome-extension://notarealkey/public"
- "hypothesis-buildext conf/production.ini firefox
--base https://hypothes.is
--assets resource://notarealkey/hypothesis/data"
# Build browser extensions
- make extensions
after_success:
- coveralls
cache:
Expand Down
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ SHELL := bash
PATH := bin:${PATH}
NPM_BIN = "$$(npm bin)"

ISODATE := $(shell TZ=UTC date '+%Y%m%d')
BUILD_ID := $(shell python -c 'import h; print(h.__version__)')

# Unless the user has specified otherwise in their environment, it's probably a
# good idea to refuse to install unless we're in an activated virtualenv.
ifndef PIP_REQUIRE_VIRTUALENV
Expand Down Expand Up @@ -64,4 +67,21 @@ cover:
lint:
@prospector

.PHONY: clean cover deps dev lint test
extensions: build/$(ISODATE)-$(BUILD_ID)-chrome-stage.zip
extensions: build/$(ISODATE)-$(BUILD_ID)-chrome-prod.zip

build/%-chrome-stage.zip:
@rm -rf build/chrome $@
hypothesis-buildext conf/production.ini chrome \
--base 'https://stage.hypothes.is' \
--assets 'chrome-extension://iahhmhdkmkifclacffbofcnmgkpalpoj/public'
@zip -r $@ build/chrome

build/%-chrome-prod.zip:
@rm -rf build/chrome $@
hypothesis-buildext conf/production.ini chrome \
--base 'https://hypothes.is' \
--assets 'chrome-extension://bjfhmglciegochdpefhhlphglcehbmek/public'
@zip -r $@ build/chrome

.PHONY: clean cover deps dev extensions lint test

0 comments on commit a39c494

Please sign in to comment.