2015-01-20 16:23:16 +01:00
|
|
|
# Contributing to Compose
|
2014-03-06 11:57:24 +01:00
|
|
|
|
2015-03-26 13:11:05 +01:00
|
|
|
Compose is a part of the Docker project, and follows the same rules and
|
|
|
|
principles. Take a read of [Docker's contributing guidelines](https://github.com/docker/docker/blob/master/CONTRIBUTING.md)
|
|
|
|
to get an overview.
|
2015-02-12 14:38:21 +01:00
|
|
|
|
2014-10-23 19:28:17 +02:00
|
|
|
## TL;DR
|
|
|
|
|
|
|
|
Pull requests will need:
|
|
|
|
|
|
|
|
- Tests
|
|
|
|
- Documentation
|
2015-02-12 14:38:21 +01:00
|
|
|
- [To be signed off](https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work)
|
2014-10-23 19:28:17 +02:00
|
|
|
- A logical series of [well written commits](https://github.com/alphagov/styleguides/blob/master/git.md)
|
|
|
|
|
2014-05-28 12:08:46 +02:00
|
|
|
## Development environment
|
|
|
|
|
2015-01-20 16:23:16 +01:00
|
|
|
If you're looking contribute to Compose
|
2014-03-06 11:57:24 +01:00
|
|
|
but you're new to the project or maybe even to Python, here are the steps
|
|
|
|
that should get you started.
|
|
|
|
|
2015-03-26 13:11:05 +01:00
|
|
|
1. Fork [https://github.com/docker/compose](https://github.com/docker/compose)
|
|
|
|
to your username.
|
|
|
|
2. Clone your forked repository locally `git clone git@github.com:yourusername/compose.git`.
|
|
|
|
3. Enter the local directory `cd compose`.
|
|
|
|
4. Set up a development environment by running `python setup.py develop`. This
|
|
|
|
will install the dependencies and set up a symlink from your `docker-compose`
|
|
|
|
executable to the checkout of the repository. When you now run
|
|
|
|
`docker-compose` from anywhere on your machine, it will run your development
|
|
|
|
version of Compose.
|
2014-03-06 11:57:24 +01:00
|
|
|
|
|
|
|
## Running the test suite
|
|
|
|
|
2015-04-27 16:00:50 +02:00
|
|
|
Use the test script to run linting checks and then the full test suite against
|
|
|
|
different Python interpreters:
|
2015-02-23 12:01:37 +01:00
|
|
|
|
2014-03-06 11:57:24 +01:00
|
|
|
$ script/test
|
|
|
|
|
2015-03-26 13:11:05 +01:00
|
|
|
Tests are run against a Docker daemon inside a container, so that we can test
|
|
|
|
against multiple Docker versions. By default they'll run against only the latest
|
|
|
|
Docker version - set the `DOCKER_VERSIONS` environment variable to "all" to run
|
|
|
|
against all supported versions:
|
2015-02-23 12:01:37 +01:00
|
|
|
|
|
|
|
$ DOCKER_VERSIONS=all script/test
|
|
|
|
|
2015-03-26 13:11:05 +01:00
|
|
|
Arguments to `script/test` are passed through to the `nosetests` executable, so
|
|
|
|
you can specify a test directory, file, module, class or method:
|
2015-02-23 12:01:37 +01:00
|
|
|
|
|
|
|
$ script/test tests/unit
|
|
|
|
$ script/test tests/unit/cli_test.py
|
|
|
|
$ script/test tests.integration.service_test
|
|
|
|
$ script/test tests.integration.service_test:ServiceTest.test_containers
|
|
|
|
|
2014-10-23 19:31:28 +02:00
|
|
|
## Building binaries
|
|
|
|
|
|
|
|
Linux:
|
|
|
|
|
|
|
|
$ script/build-linux
|
|
|
|
|
|
|
|
OS X:
|
|
|
|
|
|
|
|
$ script/build-osx
|
|
|
|
|
2015-03-26 13:11:05 +01:00
|
|
|
Note that this only works on Mountain Lion, not Mavericks, due to a
|
|
|
|
[bug in PyInstaller](http://www.pyinstaller.org/ticket/807).
|
2014-07-11 23:15:46 +02:00
|
|
|
|
|
|
|
## Release process
|
|
|
|
|
|
|
|
1. Open pull request that:
|
2015-02-05 23:36:57 +01:00
|
|
|
- Updates the version in `compose/__init__.py`
|
|
|
|
- Updates the binary URL in `docs/install.md`
|
|
|
|
- Updates the script URL in `docs/completion.md`
|
2014-07-11 23:15:46 +02:00
|
|
|
- Adds release notes to `CHANGES.md`
|
|
|
|
2. Create unpublished GitHub release with release notes
|
2015-03-26 13:11:05 +01:00
|
|
|
3. Build Linux version on any Docker host with `script/build-linux` and attach
|
|
|
|
to release
|
|
|
|
4. Build OS X version on Mountain Lion with `script/build-osx` and attach to
|
|
|
|
release as `docker-compose-Darwin-x86_64` and `docker-compose-Linux-x86_64`.
|
2014-07-11 23:15:46 +02:00
|
|
|
5. Publish GitHub release, creating tag
|
2014-07-28 22:27:22 +02:00
|
|
|
6. Update website with `script/deploy-docs`
|
2014-08-07 23:36:49 +02:00
|
|
|
7. Upload PyPi package
|
|
|
|
|
2015-02-12 14:38:21 +01:00
|
|
|
$ git checkout $VERSION
|
|
|
|
$ python setup.py sdist upload
|