Skip to content

Commit

Permalink
Bug 1203694 - [gui] provide an installer or binary for mac osx
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeLing committed Jan 19, 2016
1 parent 34f6434 commit 418d7ec
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 22 deletions.
71 changes: 49 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,64 @@
language: python
os:
- linux
- osx

python:
- "2.7"
virtualenv:
# required because we install the python-qt4 ubuntu package
system_site_packages: true
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update; brew outdated xctool || brew upgrade xctool;
pip install virtualenv;
fi

install:
# gui tests requirements
# start xvfb to emulate a graphical session
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# install PyQt4
- sudo apt-get update -qq
- sudo apt-get install python-qt4 pyqt4-dev-tools
# install mozregression code and test dependencies
- pip install -r requirements-gui-dev.txt
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export DISPLAY=:99.0;
sh -e /etc/init.d/xvfb start;
sudo apt-get update -qq;
sudo apt-get install python-qt4 pyqt4-dev-tools;
fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew install pyqt;
brew linkapps qt;
MOZPATH="$PWD";
mkdir -p /Users/travis/Library/Python/2.7/lib/python/site-packages;
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/travis/Library/Python/2.7/lib/python/site-packages/homebrew.pth;
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH;
cd /usr/local/opt/pyqt/lib/python2.7/site-packages/PyQt4;
sudo install_name_tool -id $PWD/QtCore.so QtCore.so;
sudo install_name_tool -id $PWD/QtGui.so QtGui.so;
cd $MOZPATH;
fi
- virtualenv --system-site-packages venv
- source venv/bin/activate
- pip install -r requirements-gui-dev.txt

script:
- ./check.py --with-coverage --with-gui
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then ./check.py --with-coverage --with-gui; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then ./check.py --with-gui; fi

after_success:
- pip install coveralls
- coveralls
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then pip install coveralls; coveralls; fi


before_deploy:
- python gui/build.py bundle

deploy:
provider: releases
api_key:
secure: GKlGCKzsjPyUVmtYZhOU0ggQH5RN5UgC+aEckfdguPLSnSeKxe3FLOV25zoe0+CLiYOHbsxvbTxB1fNh2KVxcrV7zroKzijhzFMAgfBP/yuCBeNWYR0tf/5qLk/xd26JQ+2Om6eyPnT+jc3JjmU7g8nYfEBrNDmtQ5Kmm0N4Crk=
- provider: releases
api-key:
secure: Fk4W2VGIKVdTnrqn984BgU5VWjHs9oQ/0ZHkld+dkjtJ3dHJ0aG8UXlXKEK5OcOCQjvHGyS+zeVuJwktCvZYw2J36YItNQZ5fDTIIpv5Zb8ZX9dD2XsOkR1urrHqiplyGMVwaGNQdtbZlkTxg6f28Jw+Rs/8f4ciCdEmGWmnSvds/WWGwzI+tqI53hK5j3wHJxVQI/aifYFdLFmsOt/G2X4R/KpyzON9rX53B27pd7hrLFbN8VM+n4xtEidLPXa6NHAEX03J0CmdnJkURHQxObDmwyk6aC2evurtmuZ6GxgOyo8QWXx7YJZBZPGUasB+SGLazQlnHXuywK77UR9luSFq+uLfJLFeP6JEU30sBP3TNxFOFJCtsUaX8IFM5GtS8pkRtT+hf//+X3pIouBoBOx3sBBGAAxmlV6bzlWXjXZOr1KAvXFyTsuhI2PXExGH725NiBlV9asVlkbJt7t5zHi9WZLLRMx5D5rq68NOWdyhIZAVVa4lQaAQxLpK2Fj3RRQvzwHqiZtESTdfwWjL9hkxO9IKhQmNuxRvEOnwLqDKB/K7badVKRasq886gs5AueI4dBrP7MdjDKtBpjweDQUjpJ3VaJFocJ1vNezm104AOYPVA9llDffu+2hlHIC3hNQ5GC3htSg4iJZtLKHAMRd/JS3ZhJfmstICrFzsUA4=
file: gui/dist/mozregression-gui.dmg
skip_cleanup: true
on:
tags: true
condition:
- $TRAVIS_OS_NAME == osx

- provider: releases
api-key:
secure: Fk4W2VGIKVdTnrqn984BgU5VWjHs9oQ/0ZHkld+dkjtJ3dHJ0aG8UXlXKEK5OcOCQjvHGyS+zeVuJwktCvZYw2J36YItNQZ5fDTIIpv5Zb8ZX9dD2XsOkR1urrHqiplyGMVwaGNQdtbZlkTxg6f28Jw+Rs/8f4ciCdEmGWmnSvds/WWGwzI+tqI53hK5j3wHJxVQI/aifYFdLFmsOt/G2X4R/KpyzON9rX53B27pd7hrLFbN8VM+n4xtEidLPXa6NHAEX03J0CmdnJkURHQxObDmwyk6aC2evurtmuZ6GxgOyo8QWXx7YJZBZPGUasB+SGLazQlnHXuywK77UR9luSFq+uLfJLFeP6JEU30sBP3TNxFOFJCtsUaX8IFM5GtS8pkRtT+hf//+X3pIouBoBOx3sBBGAAxmlV6bzlWXjXZOr1KAvXFyTsuhI2PXExGH725NiBlV9asVlkbJt7t5zHi9WZLLRMx5D5rq68NOWdyhIZAVVa4lQaAQxLpK2Fj3RRQvzwHqiZtESTdfwWjL9hkxO9IKhQmNuxRvEOnwLqDKB/K7badVKRasq886gs5AueI4dBrP7MdjDKtBpjweDQUjpJ3VaJFocJ1vNezm104AOYPVA9llDffu+2hlHIC3hNQ5GC3htSg4iJZtLKHAMRd/JS3ZhJfmstICrFzsUA4=
file: gui/mozregression-gui.tar.gz
skip_cleanup: true
on:
tags: true
tags: true
condition:
- $TRAVIS_OS_NAME == linux
6 changes: 6 additions & 0 deletions gui/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@


IS_WIN = os.name == 'nt'
IS_MAC = sys.platform == 'darwin'


def call(*args, **kwargs):
Expand Down Expand Up @@ -134,6 +135,11 @@ def do_bundle(options):
if IS_WIN:
makensis_path = os.path.join(options.nsis_path, "makensis.exe")
call(makensis_path, 'wininst.nsi', cwd='wininst')
elif IS_MAC:
arg = ['hdiutil', 'create', 'dist/mozregression-gui.dmg', '-srcfolder']
arg.append('dist/')
arg.append('-ov')
call(*arg)
else:
with tarfile.open('mozregression-gui.tar.gz', 'w:gz') as tar:
tar.add(r'dist/')
Expand Down

0 comments on commit 418d7ec

Please sign in to comment.