Skip to content

Commit

Permalink
feat: template spec and basic add feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel-Haeberli committed Oct 4, 2023
1 parent 9afb4c7 commit d77c426
Show file tree
Hide file tree
Showing 15 changed files with 1,608 additions and 469 deletions.
12 changes: 12 additions & 0 deletions momentum-core/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ func checkMandatoryTemplates(config *MomentumConfig) error {

errs := make([]error, 0)

templatePath := TemplateDir(config)
if !utils.FileExists(templatePath) {
err := utils.DirCreate(templatePath)
if err != nil {
errs = append(errs, err)
}
}

appTemplatePath := ApplicationTemplatesPath(config)
if !utils.FileExists(appTemplatePath) {
err := utils.DirCreate(appTemplatePath)
Expand Down Expand Up @@ -127,6 +135,10 @@ func initializeRepository(config *MomentumConfig) error {

cloneRepoTo(repoUrl, "", "", config.RepoDir())

if !utils.FileExists(filepath.Join(config.RepoDir(), MOMENTUM_ROOT)) {
return errors.New("invalid momentum repository")
}

return nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ const API_TEMPLATES_PREFIX = API_VERSION_BETA + "/templates"
const API_TEMPLATES_APPLICATIONS = API_TEMPLATES_PREFIX + "/applications"
const API_TEMPLATES_STAGES = API_TEMPLATES_PREFIX + "/stages"
const API_TEMPLATES_DEPLOYMENTS = API_TEMPLATES_PREFIX + "/deployments"
const API_TEMPLATES_ADD = API_TEMPLATES_PREFIX
const API_TEMPLATES_SPEC_PREFIX = API_TEMPLATES_PREFIX + "/spec"
const API_TEMPLATE_GET_SPEC = API_TEMPLATES_SPEC_PREFIX + "/:templateName"
const API_TEMPLATE_APPLY = API_TEMPLATES_SPEC_PREFIX + "/apply/:anchorArtefactId"
Loading

0 comments on commit d77c426

Please sign in to comment.