terra-ops / terra-cli

The Terra Command Line Interface
http://terra.readthedocs.org
GNU General Public License v2.0
48 stars 17 forks source link

[STORY] Customize Environment Stack #5

Open jonpugh opened 9 years ago

jonpugh commented 9 years ago

As a system administrator I would like to be able to choose from different stack configurations So that I can adjust my hosting to handle different scenarios.

Terra writes docker-compose files dynamically when creating environments.

Currently the stack for an environment is hard coded in EnvironmentFactory::getDockerComposeArray()

We should create the ability to create different "stacks" that each app and environment can choose from.

The default stack is Docker. Other stacks could interact with other PaaS tools to create the environment.

Let's create a Stack class that represents the code needed to stand up an environment. We should move the methods like getDockerComposeArray to a DockerStack class.

Once that's done let's add a "stack" property to the EnvironmentFactory class.

jonpugh commented 9 years ago

We should take inspiration from Behat.

In behat, you can specify a behat.yml file to choose what classes are loaded when the tests are run.

You can also add your own "FeatureContext" class to the bootstrap.php file in your site's source code, and it will get picked up automatically.

Lets come up with a class that an App can provide to override the EnvironmentFactory similar to how FeatureContext does it for behat tests.

jonpugh commented 9 years ago

This story is in progress for Docker, at the moment. We can now add to the docker-compose file using the app's .terra.yml file.