Skip to content

Refactor: Move hardcoded Docker constants to YAML config file #9

@yalefresne

Description

@yalefresne

Goal

Refactor the following hardcoded constants into a user-editable configuration file (dvopsctl.yaml) located at ~/.config/dvopsctl.yaml.

Context

These constants are currently hardcoded in commands/docker.go, which limits flexibility for users who may want to use different registries, GitHub organizations, or repository names. Externalizing them into a config file will improve maintainability, portability, and environment-specific customization.

Target Constants

Located in commands/docker.go:

  • defaultRegistry = "ghcr.io/mylittleparis"
  • defaultGithub = "https://github.com/MyLittleParis"
  • defaultRepositoryName = "devops-docker-php"

Acceptance Criteria

  • Create or update a config struct to include:

    docker:
      registry: ghcr.io/mylittleparis
      github_url: https://github.com/MyLittleParis
      repository_name: devops-docker-php
  • Replace hardcoded constants with values loaded from the config file

  • Implement unit tests that:

    • Load and parse the config file correctly
  • Update CLI or README documentation to reflect the new config structure

Notes

  • Config file path: ~/.config/dvopsctl.yaml
  • Use Go standard libraries

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions