Skip to content

Clearly distinguish configuration scripting and command scripting #2

@pjeby

Description

@pjeby

Because of the way doco evolved (first as a command scripting tool, then a configuration scripting tool), there's not a terribly clear distinction in the docs or examples, but there is actually a major difference between the two. Configuration scripting (declarations) determine the content of the docker-compose configuration, including defining jq functions or adding jq filters to do so. Once the config is generated, such declarations don't have much value. Likewise, there are APIs that only make sense to use in commands.

Phase 1

  • only generate jq target functions during config loading
  • Set up read-only GROUP --all := all-services at end of load
  • disable the doco function during config loading, enable it after
  • ban service declaration after load

Phase 2

  • add a way to define conditional aliases (i.e. "if this service exists (now or in future), alias it under these names/add to these groups"); maybe something like if-service foo target --default set foo
  • force declared services to exist in config

(It may be that the aliasing feature could be considered in terms of aliases and tags: tag-service foo -- bar baz would mean, "if foo ever exists, add it to group bar", while alias-service foo doco.exec-default would mean "if foo ever exists, set group doco.exec-default equal to it.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions