From 0cafdc9c6c19dab2ef2795979dc8b2f48f623379 Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Fri, 20 Dec 2013 20:28:24 +0000 Subject: [PATCH] plum -> fig --- README.md | 38 ++++++++++++++--------------- {plum => fig}/__init__.py | 0 {plum => fig}/cli/__init__.py | 0 {plum => fig}/cli/colors.py | 0 {plum => fig}/cli/command.py | 2 +- {plum => fig}/cli/docopt_command.py | 0 {plum => fig}/cli/errors.py | 0 {plum => fig}/cli/formatter.py | 0 {plum => fig}/cli/log_printer.py | 0 {plum => fig}/cli/main.py | 6 ++--- {plum => fig}/cli/multiplexer.py | 0 {plum => fig}/cli/socketclient.py | 0 {plum => fig}/cli/utils.py | 0 {plum => fig}/container.py | 0 {plum => fig}/project.py | 0 {plum => fig}/service.py | 0 setup.py | 10 ++++---- tests/container_test.py | 2 +- tests/project_test.py | 4 +-- tests/service_test.py | 2 +- tests/testcases.py | 2 +- 21 files changed, 33 insertions(+), 33 deletions(-) rename {plum => fig}/__init__.py (100%) rename {plum => fig}/cli/__init__.py (100%) rename {plum => fig}/cli/colors.py (100%) rename {plum => fig}/cli/command.py (95%) rename {plum => fig}/cli/docopt_command.py (100%) rename {plum => fig}/cli/errors.py (100%) rename {plum => fig}/cli/formatter.py (100%) rename {plum => fig}/cli/log_printer.py (100%) rename {plum => fig}/cli/main.py (98%) rename {plum => fig}/cli/multiplexer.py (100%) rename {plum => fig}/cli/socketclient.py (100%) rename {plum => fig}/cli/utils.py (100%) rename {plum => fig}/container.py (100%) rename {plum => fig}/project.py (100%) rename {plum => fig}/service.py (100%) diff --git a/README.md b/README.md index ae61648b1..09e68649e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -Plum +Fig ==== **WARNING**: This is a work in progress and probably won't work yet. Feedback welcome. -Plum is tool for defining and running application environments with Docker. It uses a simple, version-controllable YAML configuration file that looks something like this: +Fig is tool for defining and running application environments with Docker. It uses a simple, version-controllable YAML configuration file that looks something like this: ```yaml web: @@ -20,13 +20,13 @@ Installing ---------- ```bash -$ sudo pip install plum +$ sudo pip install fig ``` Defining your app ----------------- -Put a `plum.yml` in your app's directory. Each top-level key defines a "service", such as a web app, database or cache. For each service, Plum will start a Docker container, so at minimum it needs to know what image to use. +Put a `fig.yml` in your app's directory. Each top-level key defines a "service", such as a web app, database or cache. For each service, Fig will start a Docker container, so at minimum it needs to know what image to use. The simplest way to get started is to just give it an image name: @@ -35,26 +35,26 @@ db: image: orchardup/postgresql ``` -You've now given Plum the minimal amount of configuration it needs to run: +You've now given Fig the minimal amount of configuration it needs to run: ```bash -$ plum start +$ fig start Pulling image orchardup/postgresql... Starting myapp_db_1... myapp_db_1 is running at 127.0.0.1:45678 <...output from postgresql server...> ``` -For each service you've defined, Plum will start a Docker container with the specified image, building or pulling it if necessary. You now have a PostgreSQL server running at `127.0.0.1:45678`. +For each service you've defined, Fig will start a Docker container with the specified image, building or pulling it if necessary. You now have a PostgreSQL server running at `127.0.0.1:45678`. -By default, `plum start` will run until each container has shut down, and relay their output to the terminal. To run in the background instead, pass the `-d` flag: +By default, `fig start` will run until each container has shut down, and relay their output to the terminal. To run in the background instead, pass the `-d` flag: ```bash -$ plum start -d +$ fig start -d Starting myapp_db_1... done myapp_db_1 is running at 127.0.0.1:45678 -$ plum ps +$ fig ps Name State Ports ------------------------------------ myapp_db_1 Up 5432->45678/tcp @@ -62,7 +62,7 @@ myapp_db_1 Up 5432->45678/tcp ### Building services -Plum can automatically build images for you if your service specifies a directory with a `Dockerfile` in it (or a Git URL, as per the `docker build` command). +Fig can automatically build images for you if your service specifies a directory with a `Dockerfile` in it (or a Git URL, as per the `docker build` command). This example will build an image with `app.py` inside it: @@ -72,7 +72,7 @@ This example will build an image with `app.py` inside it: print "Hello world!" ``` -#### plum.yml +#### fig.yml ```yaml web: @@ -91,7 +91,7 @@ web: ### Getting your code in -If you want to work on an application being run by Plum, you probably don't want to have to rebuild your image every time you make a change. To solve this, you can share the directory with the container using a volume so the changes are reflected immediately: +If you want to work on an application being run by Fig, you probably don't want to have to rebuild your image every time you make a change. To solve this, you can share the directory with the container using a volume so the changes are reflected immediately: ```yaml web: @@ -118,8 +118,8 @@ web: This will pass an environment variable called `MYAPP_DB_1_PORT` into the web container, whose value will look like `tcp://172.17.0.4:45678`. Your web app's code can use that to connect to the database. To see all of the environment variables available, run `env` inside a container: ```bash -$ plum start -d db -$ plum run web env +$ fig start -d db +$ fig run web env ``` @@ -152,12 +152,12 @@ web: Running a one-off command ------------------------- -If you want to run a management command, use `plum run` to start a one-off container: +If you want to run a management command, use `fig run` to start a one-off container: ```bash -$ plum run db createdb myapp_development -$ plum run web rake db:migrate -$ plum run web bash +$ fig run db createdb myapp_development +$ fig run web rake db:migrate +$ fig run web bash ``` diff --git a/plum/__init__.py b/fig/__init__.py similarity index 100% rename from plum/__init__.py rename to fig/__init__.py diff --git a/plum/cli/__init__.py b/fig/cli/__init__.py similarity index 100% rename from plum/cli/__init__.py rename to fig/cli/__init__.py diff --git a/plum/cli/colors.py b/fig/cli/colors.py similarity index 100% rename from plum/cli/colors.py rename to fig/cli/colors.py diff --git a/plum/cli/command.py b/fig/cli/command.py similarity index 95% rename from plum/cli/command.py rename to fig/cli/command.py index 5bbed26be..f8899c3f6 100644 --- a/plum/cli/command.py +++ b/fig/cli/command.py @@ -21,7 +21,7 @@ class Command(DocoptCommand): @cached_property def project(self): - config = yaml.load(open('plum.yml')) + config = yaml.load(open('fig.yml')) return Project.from_config(self.project_name, config, self.client) @cached_property diff --git a/plum/cli/docopt_command.py b/fig/cli/docopt_command.py similarity index 100% rename from plum/cli/docopt_command.py rename to fig/cli/docopt_command.py diff --git a/plum/cli/errors.py b/fig/cli/errors.py similarity index 100% rename from plum/cli/errors.py rename to fig/cli/errors.py diff --git a/plum/cli/formatter.py b/fig/cli/formatter.py similarity index 100% rename from plum/cli/formatter.py rename to fig/cli/formatter.py diff --git a/plum/cli/log_printer.py b/fig/cli/log_printer.py similarity index 100% rename from plum/cli/log_printer.py rename to fig/cli/log_printer.py diff --git a/plum/cli/main.py b/fig/cli/main.py similarity index 98% rename from plum/cli/main.py rename to fig/cli/main.py index 1e91528eb..f86872173 100644 --- a/plum/cli/main.py +++ b/fig/cli/main.py @@ -62,8 +62,8 @@ class TopLevelCommand(Command): """. Usage: - plum [options] [COMMAND] [ARGS...] - plum -h|--help + fig [options] [COMMAND] [ARGS...] + fig -h|--help Options: --verbose Show more output @@ -82,7 +82,7 @@ class TopLevelCommand(Command): """ def docopt_options(self): options = super(TopLevelCommand, self).docopt_options() - options['version'] = "plum %s" % __version__ + options['version'] = "fig %s" % __version__ return options def ps(self, options): diff --git a/plum/cli/multiplexer.py b/fig/cli/multiplexer.py similarity index 100% rename from plum/cli/multiplexer.py rename to fig/cli/multiplexer.py diff --git a/plum/cli/socketclient.py b/fig/cli/socketclient.py similarity index 100% rename from plum/cli/socketclient.py rename to fig/cli/socketclient.py diff --git a/plum/cli/utils.py b/fig/cli/utils.py similarity index 100% rename from plum/cli/utils.py rename to fig/cli/utils.py diff --git a/plum/container.py b/fig/container.py similarity index 100% rename from plum/container.py rename to fig/container.py diff --git a/plum/project.py b/fig/project.py similarity index 100% rename from plum/project.py rename to fig/project.py diff --git a/plum/service.py b/fig/service.py similarity index 100% rename from plum/service.py rename to fig/service.py diff --git a/setup.py b/setup.py index 5b01a47e6..f1e3d3248 100644 --- a/setup.py +++ b/setup.py @@ -23,19 +23,19 @@ def find_version(*file_paths): setup( - name='plum', - version=find_version("plum", "__init__.py"), + name='fig', + version=find_version("fig", "__init__.py"), description='', - url='https://github.com/orchardup/plum', + url='https://github.com/orchardup/fig', author='Orchard Laboratories Ltd.', author_email='hello@orchardup.com', - packages=['plum'], + packages=['fig'], package_data={}, include_package_data=True, install_requires=[], dependency_links=[], entry_points=""" [console_scripts] - plum=plum.cli.main:main + fig=fig.cli.main:main """, ) diff --git a/tests/container_test.py b/tests/container_test.py index 8628b04d8..0d6c5f0f6 100644 --- a/tests/container_test.py +++ b/tests/container_test.py @@ -1,5 +1,5 @@ from .testcases import DockerClientTestCase -from plum.container import Container +from fig.container import Container class ContainerTest(DockerClientTestCase): def test_from_ps(self): diff --git a/tests/project_test.py b/tests/project_test.py index e96923dd5..7dd3715fb 100644 --- a/tests/project_test.py +++ b/tests/project_test.py @@ -1,5 +1,5 @@ -from plum.project import Project -from plum.service import Service +from fig.project import Project +from fig.service import Service from .testcases import DockerClientTestCase diff --git a/tests/service_test.py b/tests/service_test.py index 643473b01..02b96ab8e 100644 --- a/tests/service_test.py +++ b/tests/service_test.py @@ -1,4 +1,4 @@ -from plum import Service +from fig import Service from .testcases import DockerClientTestCase diff --git a/tests/testcases.py b/tests/testcases.py index 8fc65ee87..a930d68ec 100644 --- a/tests/testcases.py +++ b/tests/testcases.py @@ -1,5 +1,5 @@ from docker import Client -from plum.service import Service +from fig.service import Service import os from unittest import TestCase