Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion custom-recipes/buildernet/mkosi/playground.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
base: buildernet
description: Deploy the stack with the BuilderNet mkosi image (QEMU)
description: Deploy the stack with the BuilderNet mkosi image (QEMU) - check out the README before running!
hidden: true

recipe:
builder-vm:
Expand Down
9 changes: 8 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,11 @@ var recipesCmd = &cobra.Command{
}
whiteTitleColor.Println("Custom Recipes:")
for _, cr := range customRecipes {
fmt.Println(" " + customRecipesColor.Sprint(cr))
info, err := playground.GetCustomRecipeInfo(cr, recipes)
if err == nil && info.Hidden {
continue
}
fmt.Println(" " + customRecipesColor.Sprint(cr))
if err == nil {
if info.Description != "" {
descriptionColor.Add(color.Bold).Printf(" %s\n", info.Description)
Expand Down Expand Up @@ -575,6 +578,10 @@ func main() {
var customRecipes []playground.Recipe

for _, crName := range customRecipeNames {
info, err := playground.GetCustomRecipeInfo(crName, recipes)
if err == nil && info.Hidden {
continue // Skip hidden custom recipes
}
customRecipe, cleanup, err := playground.LoadCustomRecipe(crName, recipes)
if err != nil {
continue // Skip invalid custom recipes
Expand Down
2 changes: 2 additions & 0 deletions playground/custom_recipes.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type CustomRecipeInfo struct {
Name string
Description string
Base string
Hidden bool
ModifiedComponents []string
NewComponents []string
}
Expand Down Expand Up @@ -94,6 +95,7 @@ func GetCustomRecipeInfo(customRecipeName string, baseRecipes []Recipe) (*Custom
Name: customRecipeName,
Base: config.Base,
Description: config.Description,
Hidden: config.Hidden,
}

// Find the base recipe to get its components
Expand Down
3 changes: 3 additions & 0 deletions playground/recipe_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type YAMLRecipeConfig struct {
// Description is an optional description of the recipe
Description string `yaml:"description,omitempty"`

// Hidden indicates this recipe should be excluded from listings and automated discovery
Hidden bool `yaml:"hidden,omitempty"`

// Setup is a list of shell commands to run before any services are launched.
// Commands run sequentially in the recipe's directory; each must exit 0.
Setup []string `yaml:"setup,omitempty"`
Expand Down