A utility for automating multi-host, multi-environment software builds and deployments.
batou helps you to automate your application deployments:
Getting started with a new project is easy:
$ mkdir myproject $ cd myproject $ curl https://bitbucket.org/flyingcircus/batou/raw/tip/src/batou/bootstrap-template -o batou $ chmod +x batou $ ./batou
Here’s a minimal application model:
$ mkdir -p components/myapp $ cat > components/myapp/component.py from batou.component import Component from batou.lib.python import VirtualEnv, Package from batou.lib.supervisor import Program class MyApp(Component): def configure(self): venv = VirtualEnv('2.7') self += venv venv += Package('myapp') self += Program('myapp', command='bin/myapp')
And here’s a minimal environment:
$ mkdir environments $ cat > environments/dev.cfg [environment] connect_method = local [hosts] localhost = myapp
To deploy this, you run:
$ ./batou deploy dev
Check the detailed documentation to get going with a more ambitious project.
If you are having issues, please let us know. We’re around on IRC in #batou on freenode.
The project is licensed under the 2-clause BSD license.
Change default of supervisor PID file path to ensure it does something useful out of the box.
It’s still a good idea to place it on a temporary filesystem that is wiped after a reboot to ensure the PID is from a current system environment.
Remove the deprecated ‘remote’ command alias.
Remove implicit dependency of Supervisor to Logrotation and Nagios.
Supervisor now has the options logrotate and nagios that can be enabled per environment.
Compatibility note: if you update from an existing setup with supervisor you should add this to your environments that actually use those features:
[component:supervisor] logrotate = True nagios = True
Otherwise environments will complain that the RotatedLogFile and nagios.Service have unsatisfied resource requirements. Alternatively you can drop the logrotate and nrpehost or nagiosserver components in environments where you don’t need them.
Add more utilities for managing secrets: get an overview of all environments and what user keys are there, automatically add or remove users to all, one, or multiple environments.
Improve component error reporting.
Add ‘–check’ flag to deploy command. This causes batou to connect only to the first host and report any configuration errors.
The target will have their batou repository updated, so here’s a friendly reminder that your deployment should not depend on the content of the repository directly but always only on things copied to the work environment.
Make the ‘–fast’ and ‘-F’ flags more robust.
Fix up some outdated examples (not all of them, though).
Fix configuration error reporting. Removing some code that would never get run. Do not report configuration errors as deployment errors.
Display ignored hosts during connection sequence to make numbers add up and clarify what’s going on.
Improve error reporting for crontab component.
Fix error ordering.
Introduce syntax to disable deployment of hosts and components. Prefix a hostname with ‘!’ or a component name with ‘!’ to have it configured but not deployed. This supports temporary adjustments while keeping a consistent config.
We mark this red in the output because this really needs to be used carefully.
It replaces the approach in batou 1.0 where one would set up dummy hosts and use “batou local dev localhost”.
Fix curl initial bootstrap.
Allow to set the contact group of the Supervisor service check from the environment:
[component:supervisor] check_contact_groups = group1, group2
Support Git < 2.0
Add support for managing Python 3.5 environments.
Update virtualenv to newest version for Python 2.7+ and all Python 3 versions.
Drop support for Python 3.1.
Update supervisor: 3.0 -> 3.1.3
Includes updated dependencies.
Make socketpath in supervisor configurable.
Fix broken Python compatibility tests.
Do request an update for packages installed from requirements.txt within the batou environment to help update VCS checkouts that are pinned.
Clear PYTHONPATH for bootstrapping to avoid accidental interaction with unclean Python environments.
Provide ‘–fast’ mode: do not perform bootstrapping.
This is a first step to improve bootstrapping times. The switch is rather dumb but allows us to work a) offline in some cases and b) develop faster.
Fix unicode encoding/decoding in File handling. See #14944. (Ported from 1.0)
Fold the runner invocation for \(local\) and \(remote\) into a single \(deploy\) command:
$ ./batou deploy <environment>
By default batou will assume a remote environment. To configure an environment’s deployment mode use the \(connect_method\) attribute in the \(environment\) section:
[environment] connect_method = local
Improve bootstrapping to give developers a better way to get started without installing batou system-wide or in a temporary virtualenv.
Revamp README and documentation.
Rework error handling and output management.
batou will now show more errors at once, suppress unnecessary internal tracebacks and try to prioritize different errors to make complex failure situations easier to ingest.