diff --git a/application.go b/application.go index f149ee2..d1285fa 100644 --- a/application.go +++ b/application.go @@ -50,7 +50,11 @@ func NewApplication(applicationPath string, arguments []string, artifactResolver if err != nil { return Application{}, fmt.Errorf("unable to create file listing for %s\n%w", applicationPath, err) } - expected := map[string][]sherpa.FileEntry{"files": l} + expected := map[string]interface{}{ + "files": l, + "arguments": arguments, + "artifact-pattern": artifactResolver.Pattern(), + } return Application{ ApplicationPath: applicationPath, diff --git a/resolvers.go b/resolvers.go index aca8fdc..2ff702d 100644 --- a/resolvers.go +++ b/resolvers.go @@ -112,14 +112,21 @@ type ArtifactResolver struct { InterestingFileDetector InterestingFileDetector } -// Resolve resolves the artifact that was created by the build system. -func (a *ArtifactResolver) Resolve(applicationPath string) (string, error) { +// Pattern returns the glob that ArtifactResolver will use for resolution. +func (a *ArtifactResolver) Pattern() string { pattern, ok := a.ConfigurationResolver.Resolve(a.ArtifactConfigurationKey) - if !ok { - if s, ok := a.ConfigurationResolver.Resolve(a.ModuleConfigurationKey); ok { - pattern = filepath.Join(s, pattern) - } + if ok { + return pattern + } + if module, ok := a.ConfigurationResolver.Resolve(a.ModuleConfigurationKey); ok { + return filepath.Join(module, pattern) } + return pattern +} + +// Resolve resolves the artifact that was created by the build system. +func (a *ArtifactResolver) Resolve(applicationPath string) (string, error) { + pattern := a.Pattern() file := filepath.Join(applicationPath, pattern) candidates, err := filepath.Glob(file)