Bläddra i källkod

Merge pull request #25 from orchardup/ship-binaries

Ship OS X binaries
Aanand Prasad 11 år sedan
förälder
incheckning
e550451c69
8 ändrade filer med 35 tillägg och 6 borttagningar
  1. 1 0
      .gitignore
  2. 4 3
      Dockerfile
  3. 6 0
      README.md
  4. 3 0
      bin/fig
  5. 11 3
      docs/install.md
  6. 1 0
      requirements-dev.txt
  7. 3 0
      script/build-linux
  8. 6 0
      script/build-osx

+ 1 - 0
.gitignore

@@ -4,3 +4,4 @@
 /dist
 /docs/_site
 /docs/.git-gh-pages
+fig.spec

+ 4 - 3
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

+ 6 - 0
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).
 

+ 3 - 0
bin/fig

@@ -0,0 +1,3 @@
+#!/usr/bin/env python
+from fig.cli.main import main
+main()

+ 11 - 3
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:
 
-    $ sudo pip install -U fig
+    $ 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
 
-(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`.)
+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
 
 That should be all you need! Run `fig --version` to see if it worked.

+ 1 - 0
requirements-dev.txt

@@ -1,2 +1,3 @@
 mock==1.0.1
 nose==1.3.0
+pyinstaller==2.1

+ 3 - 0
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

+ 6 - 0
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