Skip to content

Commit

Permalink
feat [close #105]: Add property to decide wether to add includes per …
Browse files Browse the repository at this point in the history
…stage
  • Loading branch information
axtloss committed Dec 20, 2024
1 parent a383988 commit 45896f2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
25 changes: 13 additions & 12 deletions api/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ type Recipe struct {

// Configuration for a stage in the recipe
type Stage struct {
Id string `json:"id"`
Base string `json:"base"`
Copy []Copy `json:"copy"`
Labels map[string]string `json:"labels"`
Env map[string]string `json:"env"`
Adds []Add `json:"adds"`
Args map[string]string `json:"args"`
Runs Run `json:"runs"`
Expose map[string]string `json:"expose"`
Cmd Cmd `json:"cmd"`
Modules []interface{} `json:"modules"`
Entrypoint Entrypoint
Id string `json:"id"`
Base string `json:"base"`
Copy []Copy `json:"copy"`
Addincludes bool `json:"addincludes"`
Labels map[string]string `json:"labels"`
Env map[string]string `json:"env"`
Adds []Add `json:"adds"`
Args map[string]string `json:"args"`
Runs Run `json:"runs"`
Expose map[string]string `json:"expose"`
Cmd Cmd `json:"cmd"`
Modules []interface{} `json:"modules"`
Entrypoint Entrypoint
}

type PluginType int
Expand Down
8 changes: 5 additions & 3 deletions core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,11 @@ func BuildContainerfile(recipe *api.Recipe) error {
}

// INCLUDES.CONTAINER
_, err = containerfile.WriteString(fmt.Sprintf("ADD %s /\n", recipe.IncludesPath))
if err != nil {
return err
if stage.Addincludes {
_, err = containerfile.WriteString(fmt.Sprintf("ADD %s /\n", recipe.IncludesPath))
if err != nil {
return err
}
}

for _, cmd := range cmds {
Expand Down

0 comments on commit 45896f2

Please sign in to comment.