From 9550387e39012644e4f19a724225c17fb85a2bdf Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 3 Feb 2014 16:02:35 -0800 Subject: [PATCH 1/4] Add script to build an OS X binary --- .gitignore | 1 + README.md | 6 ++++++ bin/fig | 3 +++ script/build-osx | 6 ++++++ 4 files changed, 16 insertions(+) create mode 100755 bin/fig create mode 100755 script/build-osx diff --git a/.gitignore b/.gitignore index bdd3ac14..9a8c8325 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /dist /docs/_site /docs/.git-gh-pages +fig.spec diff --git a/README.md b/README.md index 1918d9b3..de4bbc27 100644 --- a/README.md +++ b/README.md @@ -52,4 +52,10 @@ Running the test suite $ script/test +Building OS X binaries +--------------------- + + $ script/build-osx + +Note that this only works on Mountain Lion, not Mavericks, due to a [bug in PyInstaller](http://www.pyinstaller.org/ticket/807). diff --git a/bin/fig b/bin/fig new file mode 100755 index 00000000..550a5e24 --- /dev/null +++ b/bin/fig @@ -0,0 +1,3 @@ +#!/usr/bin/env python +from fig.cli.main import main +main() diff --git a/script/build-osx b/script/build-osx new file mode 100755 index 00000000..ee011d1b --- /dev/null +++ b/script/build-osx @@ -0,0 +1,6 @@ +#!/bin/bash +set -ex +virtualenv venv +venv/bin/pip install pyinstaller==2.1 +venv/bin/pip install . +venv/bin/pyinstaller -F bin/fig From ba66c849b5a6883792f6a426f5fd09b30d9ff93a Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 3 Mar 2014 15:08:51 +0000 Subject: [PATCH 2/4] Use Python base image and run as normal user --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4d31a5a0..961a5511 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ -FROM stackbrew/ubuntu:12.04 -RUN apt-get update -qq -RUN apt-get install -y python python-pip +FROM orchardup/python:2.7 ADD requirements.txt /code/ WORKDIR /code/ RUN pip install -r requirements.txt ADD requirements-dev.txt /code/ RUN pip install -r requirements-dev.txt ADD . /code/ +RUN useradd -d /home/user -m -s /bin/bash user +RUN chown -R user /code/ +USER user From 431ce67f858e81b7fafead384201fd142ee818a7 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 3 Mar 2014 15:09:26 +0000 Subject: [PATCH 3/4] Add script to build Linux binary --- requirements-dev.txt | 1 + script/build-linux | 3 +++ 2 files changed, 4 insertions(+) create mode 100755 script/build-linux diff --git a/requirements-dev.txt b/requirements-dev.txt index 115e826e..46d6a8aa 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,3 @@ mock==1.0.1 nose==1.3.0 +pyinstaller==2.1 diff --git a/script/build-linux b/script/build-linux new file mode 100755 index 00000000..a4004611 --- /dev/null +++ b/script/build-linux @@ -0,0 +1,3 @@ +#!/bin/sh +docker build -t fig . +docker run -v `pwd`/dist:/code/dist fig pyinstaller -F bin/fig From 29f7b78deb100c682ee80b0bb1c6ae62c79b15bc Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Mon, 3 Mar 2014 15:20:09 +0000 Subject: [PATCH 4/4] Add installation instructions for binaries --- docs/install.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/install.md b/docs/install.md index 35dc3767..a2d8ba4c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -14,10 +14,18 @@ First, install Docker. If you're on OS X, you can use [docker-osx](https://githu Docker has guides for [Ubuntu](http://docs.docker.io/en/latest/installation/ubuntulinux/) and [other platforms](http://docs.docker.io/en/latest/installation/) in their documentation. -Next, install Fig: +Next, install Fig. On OS X: + + $ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/darwin > /usr/local/bin/fig + $ chmod +x /usr/local/bin/fig + +On 64-bit Linux: + + $ curl -L https://github.com/orchardup/fig/releases/download/0.3.0/linux > /usr/local/bin/fig + $ chmod +x /usr/local/bin/fig + +Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing): $ sudo pip install -U fig -(This command also upgrades Fig when we release a new version. If you don’t have pip installed, try `brew install python` or `apt-get install python-pip`.) - That should be all you need! Run `fig --version` to see if it worked.