Fix the problem with "ugly" environment syntax

We can now manage "- A=B" format as "A: B"

Some others properties than environment may have this problem (e.g.,
command) so we will fix this later.

fix #4
This commit is contained in:
2022-04-01 09:22:00 +02:00
parent a9b75c48c4
commit 7dc5d509f7
4 changed files with 96 additions and 11 deletions

View File

@@ -26,15 +26,16 @@ type HealthCheck struct {
// Service represent a "service" in a docker-compose file.
type Service struct {
Image string `yaml:"image"`
Ports []string `yaml:"ports"`
Environment map[string]string `yaml:"environment"`
Labels map[string]string `yaml:"labels"`
DependsOn []string `yaml:"depends_on"`
Volumes []string `yaml:"volumes"`
Expose []int `yaml:"expose"`
EnvFiles []string `yaml:"env_file"`
RawBuild interface{} `yaml:"build"`
HealthCheck *HealthCheck `yaml:"healthcheck"`
Command []string `yaml:"command"`
Image string `yaml:"image"`
Ports []string `yaml:"ports"`
Environment map[string]string `yaml:"-"`
RawEnvironment interface{} `yaml:"environment"`
Labels map[string]string `yaml:"labels"`
DependsOn []string `yaml:"depends_on"`
Volumes []string `yaml:"volumes"`
Expose []int `yaml:"expose"`
EnvFiles []string `yaml:"env_file"`
RawBuild interface{} `yaml:"build"`
HealthCheck *HealthCheck `yaml:"healthcheck"`
Command []string `yaml:"command"`
}