Skip to content

Improve compose generation workflow and readability#55

Open
ChaoticSciuridae wants to merge 2 commits intoironicbadger:masterfrom
ChaoticSciuridae:master
Open

Improve compose generation workflow and readability#55
ChaoticSciuridae wants to merge 2 commits intoironicbadger:masterfrom
ChaoticSciuridae:master

Conversation

@ChaoticSciuridae
Copy link
Copy Markdown

Nothing here is critical, but these tweaks made my workflow a lot smoother so I figured I'd share them in case others find them useful too.

Summary

  • Optional compose validation
  • Optional auto deploy
  • Flattened compose file structure
  • Improved readability of generated compose output

Improvements

  • Optional task to have Docker validate compose.yaml
  • Optional task to automatically run docker compose up -d on the target host (controlled via a variable)

Directory structure tweaks

Flattened the structure to use filenames instead of service directories.

Previously you'd often end up with a directory that only contained a single compose.yml. This reduces unnecessary directory nesting and makes navigating services easier in most IDEs.

config-* folders can still be used for services that require additional configuration files.

Previously the layout required something like:

Service1/
  compose.yml
Service2/
  compose.yml
Service3/
  compose.yml
  config-Service3/
    .dest
    config.yml
Service4/
  compose.yml
Service5/
  compose.yml

Now it's more compact:

service1.yml
service2.yml
service3.yml
service4.yml
service5.yml
config-Service3/
  .dest
  config.yml

Compose output readability

Disabled key sorting so the generated compose file preserves the order defined in Ansible.

Services are merged at the end so the original file ordering remains intact and spacer added between each file. Makes it much easier to scan / hop around the file IMHO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant