Tool to compile compose files with top level extension fields
Project description
Usage
usage: compose-x-render [-h] -f COMPOSEFILES [-o OUTPUT_FILE] [-x] [_ [_ ...]]
positional arguments:
_
optional arguments:
-h, --help show this help message and exit
-f COMPOSEFILES, --docker-compose-file COMPOSEFILES
Path to the Docker compose file
-o OUTPUT_FILE, --output-file OUTPUT_FILE
Output directory to write all the templates to.
-x, --compose-x-macro
Auto-Format for ECS Compose-X CFN Macro
Examples
# Simply merge two files and render into a 3rd
compose-x-render -f docker-compose.yaml -f envs/aws.yaml -o aws.yaml
# Merge two files and render in a ECS Compose-X Format for CFN Macro
compose-x-render -x -f docker-compose.yaml -f envs/aws-prod.yml -o aws-prod.yaml
Why use compose_x_render ?
When using docker-compose you can merge multiple docker-compose files together which are going to override or add settings from one definition file to the next one (with the last one having the highest priority in override).
Whilst docker-compose config execution is very useful to validate the definition of a file against a given revision, the top level extensions files, marked with x- (i.e. x-my_config) get removed whilst the ones set at the services level are left intact.
Docker Compose also does not offer a particular API in order to re-use the same validator and merge process.
Compose-X Render aims to bridge that gap, by providing both the CLI option for people to merge multiple config files with top level x-extension fields, and simply provide them with ability to provide an API input to read files, and provide the merged YAML content.
If you happen to use ECS Compose-X (off which this sub-library was created) you can render your compose files that you plan to use with the AWS CloudFormation Macro for Compose-X which allows you use it from within AWS and no CLI.
Features
Allows to assemble multiple docker-compose definitions together
Allows to preserve top-level x-fields
For use with ECS Compose-X specifically, allows to automatically generate the final ComposeFile and use the CFN macro for it.
Docker compose definitions support
3.7
3.8
3.9
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for compose_x_render-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68ce4bbbb9050c082bcbd6b23c02d6248b3b0af61b7300e76abf51a5855615e2 |
|
MD5 | 66dd46e90ddbb7b3d5d44fad2fc94025 |
|
BLAKE2b-256 | 264bc84f64603de4218d72b6b7c2cf1bf272b9f44e357535060db8272bcc585e |