Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python3 #1

Merged
merged 27 commits into from
Nov 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
28f9c8d
Add TL;DR section to CONTRIBUTING.md
bfirsh Oct 23, 2014
ea45715
Tidied up development environment instructions
bfirsh Oct 23, 2014
899670f
Move building binaries instructions
bfirsh Oct 23, 2014
e66c045
Add .dockerignore
bfirsh Oct 23, 2014
a83876d
Merge pull request #580 from bfirsh/improve-contributing-instructions
aanand Oct 24, 2014
11280e4
Merge pull request #581 from bfirsh/add-dockerignore
aanand Oct 24, 2014
b47ab2b
Update wordpress url on wordpress example
kevinsimper Oct 24, 2014
b64ea85
fix insecure parameter
npeters Oct 27, 2014
1bd3d0d
Merge pull request #584 from kevinsimper/patch-1
aanand Oct 31, 2014
782a46f
Fixes #602 Allowing `help $cmd` with no figfile
kojiromike Nov 1, 2014
604b370
Merge pull request #606 from kojiromike/602-no-help-without-figfile
aanand Nov 3, 2014
cb275b8
Merge pull request #591 from npeters/fix-insecure-registry
aanand Nov 3, 2014
38a3ee8
Use upstream dockerpty 0.3.2
bfirsh Oct 27, 2014
8773f51
Don't select stdin when interactive=False
bfirsh Nov 4, 2014
9abdd33
Add signal in the kill CLI commando to send a specific signal to the …
raulcd Nov 3, 2014
9260603
Merge pull request #588 from bfirsh/use-upstream-dockerpty
aanand Nov 4, 2014
46433c7
Ship 1.0.1
bfirsh Nov 4, 2014
06a1b32
Make @dnephin a maintainer
bfirsh Nov 5, 2014
5dde2a2
Merge pull request #612 from bfirsh/ship-1.0.1
aanand Nov 5, 2014
3f4b161
Merge pull request #618 from bfirsh/make-dnephin-a-maintainer
aanand Nov 5, 2014
f98323b
Support multiple port mappings for same internal port
drewkett Nov 7, 2014
4f6d028
Move to build_port_bindings(). Added Tests
drewkett Nov 7, 2014
d3e94f2
Merge pull request #624 from drewkett/multiple_port_mappings
dnephin Nov 7, 2014
65ae22e
Merge pull request #611 from raulcd/604_support_reloading_containers
dnephin Nov 13, 2014
ee03199
Support python 3
dnephin Aug 19, 2014
12ee260
Fixing errors when using Python 3.x
Nov 27, 2014
89ae4d9
Merging conflict
Nov 27, 2014
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change log
==========

1.0.1 (2014-11-04)
------------------

- Added an `--allow-insecure-ssl` option to allow `fig up`, `fig run` and `fig pull` to pull from insecure registries.
- Fixed `fig run` not showing output in Jenkins.
- Fixed a bug where Fig couldn't build Dockerfiles with ADD statements pointing at URLs.

1.0.0 (2014-10-16)
------------------

Expand Down
40 changes: 23 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
# Contributing to Fig

## TL;DR

Pull requests will need:

- Tests
- Documentation
- [To be signed off](#sign-your-work)
- A logical series of [well written commits](https://github.com/alphagov/styleguides/blob/master/git.md)

## Development environment

If you're looking contribute to [Fig](http://www.fig.sh/)
but you're new to the project or maybe even to Python, here are the steps
that should get you started.

1. Fork [https://github.com/docker/fig](https://github.com/docker/fig) to your username. kvz in this example.
1. Clone your forked repository locally `git clone git@github.com:kvz/fig.git`.
1. Fork [https://github.com/docker/fig](https://github.com/docker/fig) to your username.
1. Clone your forked repository locally `git clone git@github.com:yourusername/fig.git`.
1. Enter the local directory `cd fig`.
1. Set up a development environment `python setup.py develop`. That will install the dependencies and set up a symlink from your `fig` executable to the checkout of the repo. So from any of your fig projects, `fig` now refers to your development project. Time to start hacking : )
1. Works for you? Run the test suite via `./script/test` to verify it won't break other usecases.
1. All good? Commit and push to GitHub, and submit a pull request.
1. Set up a development environment by running `python setup.py develop`. This will install the dependencies and set up a symlink from your `fig` executable to the checkout of the repository. When you now run `fig` from anywhere on your machine, it will run your development version of Fig.

## Running the test suite

$ script/test

## Building binaries

Linux:

$ script/build-linux

OS X:

$ 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).

## Sign your work

The sign-off is a simple line at the end of the explanation for the
Expand Down Expand Up @@ -73,6 +68,17 @@ The easiest way to do this is to use the `--signoff` flag when committing. E.g.:

$ git commit --signoff

## Building binaries

Linux:

$ script/build-linux

OS X:

$ 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).

## Release process

Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Aanand Prasad <aanand.prasad@gmail.com> (@aanand)
Ben Firshman <ben@firshman.co.uk> (@bfirsh)
Chris Corbyn <chris@w3style.co.uk> (@d11wtq)
Daniel Nephin <dnephin@gmail.com> (@dnephin)
Nathan LeClaire <nathan.leclaire@gmail.com> (@nathanleclaire)
4 changes: 3 additions & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ Get help on a command.

### kill

Force stop service containers.
Force stop running containers by sending a `SIGKILL` signal. Optionally the signal can be passed, for example:

$ fig kill -s SIGINT

### logs

Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ There are also guides for [Ubuntu](https://docs.docker.com/installation/ubuntuli

Next, install Fig:

curl -L https://github.com/docker/fig/releases/download/1.0.0/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig
curl -L https://github.com/docker/fig/releases/download/1.0.1/fig-`uname -s`-`uname -m` > /usr/local/bin/fig; chmod +x /usr/local/bin/fig

Releases are available for OS X and 64-bit Linux. Fig is also available as a Python package if you're on another platform (or if you prefer that sort of thing):

Expand Down
2 changes: 1 addition & 1 deletion docs/wordpress.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Getting started with Fig and Wordpress

Fig makes it nice and easy to run Wordpress in an isolated environment. [Install Fig](install.html), then download Wordpress into the current directory:

$ curl http://wordpress.org/wordpress-3.8.1.tar.gz | tar -xvzf -
$ curl https://wordpress.org/latest.tar.gz | tar -xvzf -

This will create a directory called `wordpress`, which you can rename to the name of your project if you wish. Inside that directory, we create `Dockerfile`, a file that defines what environment your app is going to run in:

Expand Down
2 changes: 1 addition & 1 deletion fig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import unicode_literals
from .service import Service # noqa:flake8

__version__ = '1.0.0'
__version__ = '1.0.1'
7 changes: 6 additions & 1 deletion fig/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Command(DocoptCommand):
def dispatch(self, *args, **kwargs):
try:
super(Command, self).dispatch(*args, **kwargs)
except SSLError, e:
except SSLError as e:
raise errors.UserError('SSL error: %s' % e)
except ConnectionError:
if call_silently(['which', 'docker']) != 0:
Expand All @@ -42,6 +42,11 @@ def dispatch(self, *args, **kwargs):
raise errors.ConnectionErrorGeneric(self.get_client().base_url)

def perform_command(self, options, handler, command_options):
if options['COMMAND'] == 'help':
# Skip looking up the figfile.
handler(None, command_options)
return

explicit_config_path = options.get('--file') or os.environ.get('FIG_FILE')
project = self.get_project(
self.get_config_path(explicit_config_path),
Expand Down
14 changes: 10 additions & 4 deletions fig/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from operator import attrgetter

from inspect import getdoc
from fig.packages import dockerpty
import dockerpty

from .. import __version__
from ..project import NoSuchService, ConfigurationError
Expand Down Expand Up @@ -133,9 +133,15 @@ def kill(self, project, options):
"""
Force stop service containers.

Usage: kill [SERVICE...]
Usage: kill [options] [SERVICE...]

Options:
-s SIGNAL SIGNAL to send to the container.
Default signal is SIGKILL.
"""
project.kill(service_names=options['SERVICE'])
signal = options.get('-s', 'SIGKILL')

project.kill(service_names=options['SERVICE'], signal=signal)

def logs(self, project, options):
"""
Expand Down Expand Up @@ -323,7 +329,7 @@ def run(self, project, options):
print(container.name)
else:
service.start_container(container, ports=None, one_off=True)
dockerpty.start(project.client, container.id)
dockerpty.start(project.client, container.id, interactive=not options['-T'])
exit_code = container.wait()
if options['--rm']:
log.info("Removing %s..." % container.name)
Expand Down
6 changes: 3 additions & 3 deletions fig/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def get(self, key):
def get_value(dictionary, key):
return (dictionary or {}).get(key)

return reduce(get_value, key.split('.'), self.dictionary)
return six.moves.reduce(get_value, key.split('.'), self.dictionary)

def get_local_port(self, port, protocol='tcp'):
port = self.ports.get("%s/%s" % (port, protocol))
Expand All @@ -124,8 +124,8 @@ def start(self, **options):
def stop(self, **options):
return self.client.stop(self.id, **options)

def kill(self):
return self.client.kill(self.id)
def kill(self, **options):
return self.client.kill(self.id, **options)

def restart(self):
return self.client.restart(self.id)
Expand Down
27 changes: 0 additions & 27 deletions fig/packages/dockerpty/__init__.py

This file was deleted.

Loading