diff --git a/config.json b/config.json index 8a0dbc7..cd7f2dd 100644 --- a/config.json +++ b/config.json @@ -29,6 +29,12 @@ "dependency": [ "wordpress" ] + }, + { + "name": "postgres", + "repository": "https://github.com/ChristianLempa/boilerplates.git", + "branch": "ansible-hosts-variable-removal", + "path": "docker-compose/postgres/docker-compose.yaml" } ], "dependency": { diff --git a/internal/docker/project.go b/internal/docker/project.go index 572facf..b16dd9d 100644 --- a/internal/docker/project.go +++ b/internal/docker/project.go @@ -50,7 +50,11 @@ func (project *Project) Start() error { } copyutil.CopyDir(filesys.MakeFsOnDisk(), srcDir, getAbsoluteProjectPath(*project)) } else { - _, execErr := GitExec("clone", project.Repository, getAbsoluteProjectPath(*project)) + gitArgs := []string{"clone", project.Repository, getAbsoluteProjectPath(*project)} + if project.Branch != "" { + gitArgs = append(gitArgs, "-b", project.Branch) + } + _, execErr := GitExec(gitArgs...) if execErr != nil { return errors.Join(errors.New("git exec error"), execErr) } diff --git a/internal/docker/struct.go b/internal/docker/struct.go index 11a424f..0abd8f7 100644 --- a/internal/docker/struct.go +++ b/internal/docker/struct.go @@ -9,6 +9,7 @@ type Project struct { Name string `json:"name"` Local string `json:"local"` Repository string `json:"repository"` + Branch string `json:"branch"` Path string `json:"path"` PreAction []string `json:"pre-action"` PostAction []string `json:"post-action"`