big refactor
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2024-06-24 23:20:54 +02:00
parent b688ddc4b1
commit cbab9b5907
27 changed files with 411 additions and 324 deletions

View File

@ -210,7 +210,7 @@ func LintComposeVersion(recipe recipe.Recipe) (bool, error) {
}
func LintEnvConfigPresent(recipe recipe.Recipe) (bool, error) {
envSample := fmt.Sprintf("%s/%s/.env.sample", config.RECIPES_DIR, recipe.Name)
envSample := fmt.Sprintf("%s/%s/.env.sample", recipe.Dir)
if _, err := os.Stat(envSample); !os.IsNotExist(err) {
return true, nil
}
@ -233,7 +233,7 @@ func LintAppService(recipe recipe.Recipe) (bool, error) {
// the recipe. This typically means that no domain is required to deploy and
// therefore no matching traefik deploy label will be present.
func LintTraefikEnabledSkipCondition(recipe recipe.Recipe) (bool, error) {
envSamplePath := path.Join(config.RECIPES_DIR, recipe.Name, ".env.sample")
envSamplePath := path.Join(recipe.Dir, ".env.sample")
sampleEnv, err := config.ReadEnv(envSamplePath)
if err != nil {
return false, fmt.Errorf("Unable to discover .env.sample for %s", recipe.Name)
@ -358,7 +358,7 @@ func LintHasPublishedVersion(recipe recipe.Recipe) (bool, error) {
}
func LintMetadataFilledIn(r recipe.Recipe) (bool, error) {
features, category, err := recipe.GetRecipeFeaturesAndCategory(r.Name)
features, category, err := r.GetRecipeFeaturesAndCategory()
if err != nil {
return false, err
}